1 <!-- -*- DocBook -*- -->
4 <title>Introduction</title>
8 <para>&clsql; is a Common Lisp interface to <glossterm
9 linkend="gloss-sql">SQL</glossterm> databases. A number of Common
10 Lisp implementations and SQL databases are supported.The general
11 structure of &clsql; is based on the
12 <application>CommonSQL</application> package by Xanalys.</para>
16 <title>History</title>
18 &clsql; is written by Kevin M. Rosenberg and based substantially
19 on Pierre R. Mai's excellent &maisql; package. The main changes have
20 been to port the &ffi; to &uffi;, add to Allegro's ODBC interface as a
21 supported database, add a compatibility layer for &cmucl; specific
22 code, and make the code more robust in terms of &mysql; support.
27 <title>Prerequisites</title>
30 <title>&defsystem;</title>
31 <para> &clsql; uses &defsystem to compile and load its
32 components. &defsystem; is included in the <ulink
33 url="http://clocc.sourceforge.net"><citetitle>&clocc;</citetitle></ulink>. The
34 defsystem version in the pre-packaged distribution is rather old and
35 may not function well. The version in CVS tree tree works quite
36 well. For convenience, a copy of the latest defsystem at the FTP
38 url="ftp://ftp.med-info.com/pub/defsystem/"><citetitle>site</citetitle></ulink>
45 <para> &clsql; uses <ulink
46 url="http://uffi.med-info.com/"><citetitle>&uffi;</citetitle></ulink>
47 as a <emphasis>Foreign Function Interface</emphasis> (<glossterm
48 linkend="gloss-ffi">FFI</glossterm>) to support multiple &cl;
49 implementations.</para>
51 <para>You can download &uffi; from its FTP <ulink
52 url="ftp://ftp.med-info.com/pub/uffi/"><citetitle>site</citetitle></ulink>. There
53 are zip files for Microsoft Windows systems and gzipped tar files for
58 <title>Supported Common Lisp Implementation</title>
60 The implementations that support &clsql; is governed by the supported
61 implementations of &uffi;. At the time of the initial release of &clsql;,
62 the following implementations are supported:
64 <itemizedlist mark="opencircle">
65 <listitem><para>&acl; v6.1 on Redhat Linux 7.2 and Microsoft Windows.</para></listitem>
66 <listitem><para>&lw; v4.2 on Redhat Linux 7.2 and Microsoft Windows.</para></listitem>
67 <listitem><para>&cmucl; 18d on Redhat Linux 7.2.</para></listitem>
72 <title>Supported &sql; Implementation</title>
74 Currently, &clsql; supports the following databases:
76 <itemizedlist mark="opencircle">
77 <listitem><para>&mysql; v3.23.49 on Redhat Linux 7.2 and Microsoft Windows.</para></listitem>
78 <listitem><para>&postgresql; v7.1 on Redhat Linux 7.2. Support for both direct API connections and TCP socket connections.</para></listitem>
79 <listitem><para>Allegro's ODBC interface (&aodbc;) on Redhat Linux 7.2 and Microsoft Windows.</para></listitem>
86 <title>Installation</title>
89 <title>Ensure &defsystem; is loaded</title>
91 Simply load the file <filename>defsystem.lisp</filename>.
93 (load "defsystem.lisp")
99 <title>Build <filename>clsql-mysql</filename> helper library</title>
100 <para>&mysql; uses functions that require 64-bit integer
101 parameters and return values. The &ffi; in most &clsql;
102 implementations do not support 64-bit integers. Thus, a C helper
103 library is required to break these 64-bit integers into two compatible
104 32-bit integers.</para>
106 <para><filename>Makefile</filename>'s for Microsoft Windows and GNU/Solaris systems
107 are supplied to build this library. In addition, the <type>DLL</type> and <type>LIB</type>
108 files for Microsoft Windows are supplied with the distribution.</para>
110 <para>To build the library, first move to the directory
111 <filename>interfaces/mysql</filename> directory. You may need to
112 edit <filename>Makefile</filename> or <filename>Makefile.msvc</filename> to
113 correctly specify the location of your &mysql; installation. On UNIX systems, use
115 <programlisting>make</programlisting>. On a Microsoft Windows system,
116 use the command: <programlisting>nmake /f
117 Makefile.msvc</programlisting>.</para>
121 <title>Load &uffi;</title>
123 Unpack the appropriate &uffi; version for your system which creates a directory
124 for the &uffi; files. Add that directory to &defsystem; <varname>*central-registry*</varname>.
125 You can do that by either pushing the pathname of the directory onto this variable, or
126 use the new <function>add-registry-location</function> present in the newest versions of
127 &defsystem;. The below example code assumes the &uffi; files reside in the
128 <filename>/usr/local/src/lisp/uffi</filename> directory.
130 (mk:add-registry-location #P"/usr/local/src/lisp/uffi")
131 (mk:load-system :uffi)