r8589: fix typo
[clsql.git] / doc / intro.xml
1 <?xml version='1.0' ?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3                "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4 <!ENTITY % myents SYSTEM "entities.inc">
5 %myents;
6 ]>
7
8 <chapter id="introduction">
9   <title>Introduction</title>
10
11   <sect1 id="purpose">
12     <title>Purpose</title>
13     <para>&clsql; is a Common Lisp interface to <glossterm
14       linkend="gloss-sql">SQL</glossterm> databases.  A number of Common
15       Lisp implementations and SQL databases are supported. The general
16       structure of &clsql; is based on the
17       <application>CommonSQL</application> 
18       package by Xanalys.
19     </para>
20   </sect1>
21   
22   <sect1 id="history">
23     <title>History</title>
24     <para>
25       &clsql; is written by Kevin M. Rosenberg and based substantially
26       on Pierre R. Mai's excellent &maisql; package. The main changes
27       from &maisql; are:
28       <itemizedlist>
29         <listitem>
30           <para>port from the &cmucl; FFI to &uffi;.</para>
31         </listitem>
32         <listitem>
33           <para>Optimized loading of integer and floating-point fields.</para>
34         </listitem>
35         <listitem>
36           <para>new &acl; ODBC interface back-end.</para>
37         </listitem>
38         <listitem>
39           <para>compatibility layer for &cmucl; specific code.</para>
40         </listitem>
41         <listitem>
42           <para>much improved robustness for the &mysql; back-end
43           along with version 4 client library support.</para>
44         </listitem>
45         <listitem>
46           <para>improved system loading.</para>
47         </listitem>
48         <listitem>
49           <para>improved packages and symbol export.</para>
50         </listitem>
51         <listitem>
52           <para>transaction support.</para>
53         </listitem>
54       </itemizedlist>
55     </para>
56   </sect1>
57   
58   <sect1 id="prerequisites">
59     <title>Prerequisites</title>
60     
61     <sect2>
62       <title>&asdf;</title>
63       <para>
64         &clsql; uses &asdf; to compile and load its components.
65         &asdf; is included in the <ulink
66         url="http://cclan.sourceforge.net"><citetitle>&cclan;</citetitle></ulink>
67         collection.
68       </para>
69     </sect2>
70     
71     <sect2>
72       <title>&uffi;</title>
73       <para>
74         &clsql; uses <ulink
75         url="http://uffi.b9.com/"><citetitle>&uffi;</citetitle></ulink>
76         as a <emphasis>Foreign Function Interface</emphasis>
77         (<glossterm linkend="gloss-ffi">FFI</glossterm>) to support
78         multiple &cl; implementations.
79       </para> 
80     </sect2>
81     
82     <sect2>
83       <title>&md5;</title>
84       <para>&clsql;'s postgresql-socket interface uses Pierre Mai's 
85         <ulink url="ftp://clsql.b9.com/">md5</ulink>
86         module.
87       </para>       
88     </sect2>
89     <sect2>
90       <title>Supported Common Lisp Implementation</title>
91       <para>
92         The implementations that support &clsql; is governed by the supported
93         implementations of &uffi;. The following implementations are supported:
94       </para>
95       <itemizedlist mark="opencircle">
96         <listitem><para>&acl; v6.2 on Debian Linux, FreeBSD 4.5, and Microsoft Windows XP.</para></listitem>
97         <listitem><para>&lw; v4.3 on Debian Linux and Microsoft Windows XP.</para></listitem>
98         <listitem><para>&cmucl; 18e on Debian Linux, FreeBSD 4.5, and Solaris 2.8.</para></listitem>
99         <listitem><para>&sbcl; 0.8.5 on Debian Linux.</para></listitem>
100         <listitem><para>&scl; 1.1.1 on Debian Linux.</para></listitem>
101         <listitem><para>&openmcl; 0.14 on Debian Linux PowerPC.</para></listitem>
102       </itemizedlist>
103     </sect2>
104     
105     <sect2>
106       <title>Supported &sql; Implementation</title>
107       <para>
108         Currently, &clsql; supports the following databases:
109       </para>
110       <itemizedlist mark="opencircle">
111         <listitem><para>&mysql; v3.23.51 and v4.0.15.</para></listitem>
112         <listitem><para>&postgresql; v7.2 with both direct API and TCP
113         socket connections.</para></listitem>
114         <listitem><para>Allegro's ODBC interface (&aodbc;) using iODBC
115         ODBC manager.</para></listitem>
116       </itemizedlist>
117     </sect2>
118     
119   </sect1>
120   
121   <sect1 id="installation">
122     <title>Installation</title>
123     
124     <sect2>
125       <title>Ensure &asdf; is loaded</title>
126       <para>
127         Simply load the file <filename>asdf.lisp</filename>.
128         <screen>
129 (load "asdf.lisp")
130         </screen>
131       </para>
132     </sect2>
133     
134     <sect2>
135       <title>Build &c; helper libraries</title>
136       <para>&clsql; uses functions that require 64-bit integer
137         parameters and return values. The &ffi; in most &clsql;
138         implementations do not support 64-bit integers. Thus, C helper
139         libraries are required to break these 64-bit integers into two compatible
140         32-bit integers. The helper libraries reside in the directories
141         <filename>uffi</filename> and <filename>db-mysql</filename>.
142       </para>
143       
144       <sect3>
145         <title>&mswindows;</title>
146         <para>
147           Files named <filename>Makefile.msvc</filename> are supplied
148           for building the libraries under Microsoft Windows.  Since
149           &mswindows; does not come with that compiler, compiled
150           <type>DLL</type> and <type>LIB</type> library files are
151           supplied with &clsql;.
152         </para>
153       </sect3>
154
155       <sect3>
156         <title>&unix;</title>
157         <para>
158           Files named <filename>Makefile</filename> are supplied for
159           building the libraries under &unix;. Loading the
160           <filename>.asd</filename> files automatically invokes
161           <application>make</application> when necessary. So, manual
162           building of the helper libraries is not necessary on most
163           &unix; systems. However, the location of the &mysql; library
164           files and include files may need to adjusted in
165           <filename>db-mysql/Makefile</filename> on non-Debian
166           systems.
167         </para>
168       </sect3>
169       
170     </sect2>
171     
172     <sect2>
173       <title>Load &uffi;</title>
174       <para>
175         Unzip or untar the &uffi; distribution which creates a directory
176         for the &uffi; files. Add that directory to &asdf;'s <varname>asdf:*central-registry*</varname>.
177         You can do that by pushing the pathname of the directory onto this variable.
178         The following example code assumes the &uffi; files reside in the
179         <filename>/usr/share/lisp/uffi/</filename> 
180         directory.
181         <screen>
182 (push #P"/usr/share/lisp/uffi/" asdf:*central-registry*)
183 (asdf:operate 'asdf:load-op :uffi)
184         </screen>
185       </para>
186     </sect2>
187    <sect2>
188      <title>Load &md5; module</title>
189      <para>
190        If you plan to use the clsql-postgresql-socket interface, you
191        must load the md5 module.  Unzip or untar the cl-md5
192        distribution, which creates a directory for the cl-md5 files.
193        Add that directory to &asdf;'s
194        <varname>asdf:*central-registry*</varname>.  You can do that by
195        pushing the pathname of the directory onto this variable.  The
196        following example code assumes the cl-md5 files reside in the
197        <filename>/usr/share/lisp/cl-md5/</filename> directory.
198        <screen>
199 (push #P"/usr/share/lisp/cl-md5/" asdf:*central-registry*)
200 (asdf:operate 'asdf:load-op :md5)
201        </screen>
202      </para>
203    </sect2>
204    
205    <sect2>
206      <title>Load &clsql; modules</title>
207      <para>
208        Unzip or untar the &clsql; distribution which creates a
209        directory for the &clsql; files. Add that directory to &asdf;'s
210        <varname>asdf:*central-registry*</varname>.  You can do that by
211        pushing the pathname of the directory onto this variable.  The
212        following example code assumes the &clsql; files reside in the
213        <filename>/usr/share/lisp/clsql/</filename> directory. You need
214        to load, at a minimum, the main <symbol>clsql</symbol> system
215        and at least one interface system. The below example show loading
216        all &clsql; systems.
217
218         <screen>
219 (push #P"/usr/share/lisp/clsql/" asdf:*central-registry*)
220 (asdf:operate 'asdf:load-op 'clsql-base)              ; base CLSQL package
221 (asdf:operate 'asdf:load-op 'clsql-mysql)             ; MySQL interface
222 (asdf:operate 'asdf:load-op 'clsql-postgresql)        ; PostgreSQL interface
223 (asdf:operate 'asdf:load-op 'clsql-postgresql-socket) ; Socket PGSQL interface
224 (asdf:operate 'asdf:load-op 'clsql-aodbc)             ; Allegro ODBC interface
225 (asdf:operate 'asdf:load-op 'clsql)                   ; main CLSQL package
226         </screen>
227       </para>
228     </sect2>
229     
230     <sect2>
231       <title>Run test suite</title>
232       <para>
233         After loading &clsql;, you can execute the test suite. A
234         configuration file named
235         <filename>.clsql-test.config</filename> must be created in
236         your home directory. There are instructures on the format of
237         that file in the <filename>tests/tests.lisp</filename> file in
238         the &clsql; source directory. After creating that file, you
239         can run the test suite with &asdf;:
240         <screen>
241           (asdf:operate 'asdf:test-op 'clsql)
242         </screen>
243       </para>
244     </sect2>
245     
246   </sect1>
247
248 </chapter>
249