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 from &maisql;
23 <para>port from the &cmucl; FFI to &uffi;.</para>
26 <para>new &acl; ODBC interface back-end.</para>
29 <para>compatibility layer for &cmucl; specific code.</para>
32 <para>improved robustness of the &mysql; back-end.</para>
35 <para>improved system loading.</para>
38 <para>improved packages and symbol export.</para>
45 <title>Prerequisites</title>
48 <title>&defsystem;</title>
49 <para> &clsql; uses &defsystem to compile and load its
50 components. &defsystem; is included in the <ulink
51 url="http://clocc.sourceforge.net"><citetitle>&clocc;</citetitle></ulink> collection. The
52 version in the pre-packaged distribution is rather old and
53 may not function well. The version in CVS tree tree works quite
54 well. For convenience, a copy of the latest &defsystem; at the FTP
56 url="ftp://ftp.med-info.com/pub/defsystem/"><citetitle>site</citetitle></ulink>
63 <para> &clsql; uses <ulink
64 url="http://uffi.med-info.com/"><citetitle>&uffi;</citetitle></ulink>
65 as a <emphasis>Foreign Function Interface</emphasis> (<glossterm
66 linkend="gloss-ffi">FFI</glossterm>) to support multiple &cl;
67 implementations.</para>
69 <para>You can download &uffi; from its FTP <ulink
70 url="ftp://ftp.med-info.com/pub/uffi/"><citetitle>site</citetitle></ulink>. There
71 are zip files for Microsoft Windows systems and gzipped tar files for
76 <title>Supported Common Lisp Implementation</title>
78 The implementations that support &clsql; is governed by the supported
79 implementations of &uffi;. At the time of the initial release of &clsql;,
80 the following implementations are supported:
82 <itemizedlist mark="opencircle">
83 <listitem><para>&acl; v6.1 on Redhat Linux 7.2 and Microsoft Windows.</para></listitem>
84 <listitem><para>&lw; v4.2 on Redhat Linux 7.2 and Microsoft Windows.</para></listitem>
85 <listitem><para>&cmucl; 18d on Redhat Linux 7.2.</para></listitem>
90 <title>Supported &sql; Implementation</title>
92 Currently, &clsql; supports the following databases:
94 <itemizedlist mark="opencircle">
95 <listitem><para>&mysql; v3.23.49 on Redhat Linux 7.2 and Microsoft Windows.</para></listitem>
96 <listitem><para>&postgresql; v7.1 on Redhat Linux 7.2. Support for both direct API connections and TCP socket connections.</para></listitem>
97 <listitem><para>Allegro's ODBC interface (&aodbc;) on Redhat Linux 7.2 and Microsoft Windows.</para></listitem>
104 <title>Installation</title>
107 <title>Ensure &defsystem; is loaded</title>
109 Simply load the file <filename>defsystem.lisp</filename>.
111 (load "defsystem.lisp")
117 <title>Build <filename>clsql-mysql</filename> helper library</title>
118 <para>&mysql; uses functions that require 64-bit integer
119 parameters and return values. The &ffi; in most &clsql;
120 implementations do not support 64-bit integers. Thus, a C helper
121 library is required to break these 64-bit integers into two compatible
122 32-bit integers.</para>
124 <para><filename>Makefile</filename>'s for Microsoft Windows and GNU/Solaris systems
125 are supplied to build this library. In addition, the <type>DLL</type> and <type>LIB</type>
126 files for Microsoft Windows are supplied with the distribution.</para>
128 <para>To build the library, first move to the directory
129 <filename>interfaces/mysql</filename> directory. You may need to
130 edit <filename>Makefile</filename> or <filename>Makefile.msvc</filename> to
131 correctly specify the location of your &mysql; installation. On UNIX systems, use
133 <programlisting>make</programlisting>
134 On a Microsoft Windows system,
139 </programlisting></para>
143 <title>Load &uffi;</title>
145 Unpack the appropriate &uffi; version for your system which creates a directory
146 for the &uffi; files. Add that directory to Defsystem's <varname>mk:*central-registry*</varname>.
147 You can do that by either pushing the pathname of the directory onto this variable, or
148 use the new <function>add-registry-location</function> present in the newest versions of
149 &defsystem;. The following example code assumes the &uffi; files reside in the
150 <filename>/usr/local/src/lisp/uffi</filename> directory.
152 (mk:add-registry-location #P"/usr/local/src/lisp/uffi")
153 (mk:load-system :uffi)