r8207: fix making libraries
[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.xml">
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 from &maisql;
27       are:
28       <itemizedlist>
29         <listitem>
30           <para>Optimized loading of integer and floating-point fields.</para>
31         </listitem>
32         <listitem>
33           <para>port from the &cmucl; FFI to &uffi;.</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.</para>
43         </listitem>
44         <listitem>
45           <para>improved system loading.</para>
46         </listitem>
47         <listitem>
48           <para>improved packages and symbol export.</para>
49         </listitem>
50         <listitem>
51           <para>transaction support.</para>
52         </listitem>
53       </itemizedlist>
54     </para>
55   </sect1>
56   
57   <sect1 id="prerequisites">
58     <title>Prerequisites</title>
59     
60     <sect2>
61       <title>&asdf;</title>
62       <para> &clsql; uses &asdf; to compile and load its
63         components.  &asdf; is included in the <ulink
64         url="http://cclan.sourceforge.net"><citetitle>&cclan;</citetitle></ulink> collection.
65       </para>
66     </sect2>
67     
68     <sect2>
69       <title>&uffi;</title>
70       <para>&clsql; uses <ulink
71         url="http://uffi.med-info.com/"><citetitle>&uffi;</citetitle></ulink>
72         as a <emphasis>Foreign Function Interface</emphasis> (<glossterm
73         linkend="gloss-ffi">FFI</glossterm>) to support multiple &cl;
74         implementations.
75       </para> 
76       
77       <para>You can download &uffi; from its FTP <ulink
78         url="ftp://ftp.med-info.com/pub/uffi/"><citetitle>site</citetitle></ulink>. There
79         are zip files for Microsoft Windows systems and gzipped tar files for
80         other systems.
81       </para>
82     </sect2>
83     
84     <sect2>
85       <title>&md5;</title>
86       <para>&clsql;'s postgresql-socket interface uses Pierre Mai's 
87         <ulink url="ftp://clsql.b9.com/">md5</ulink>
88         module. If you plan to use
89         this interface please download the md5 module from ftp://clsql.b9.com.
90       </para>       
91     </sect2>
92     <sect2>
93       <title>Supported Common Lisp Implementation</title>
94       <para>
95         The implementations that support &clsql; is governed by the supported
96         implementations of &uffi;. The following implementations are supported:
97       </para>
98       <itemizedlist mark="opencircle">
99         <listitem><para>&acl; v6.2 on Debian Linux, FreeBSD 4.5, and Microsoft Windows XP.</para></listitem>
100         <listitem><para>&lw; v4.3 on Debian Linux and Microsoft Windows XP.</para></listitem>
101         <listitem><para>&cmucl; 18e on Debian Linux, FreeBSD 4.5, and Solaris 2.8.</para></listitem>
102         <listitem><para>&sbcl; 0.8.5 on Debian Linux.</para></listitem>
103         <listitem><para>&scl; 1.2 on Debian Linux.</para></listitem>
104         <listitem><para>&openmcl; 0.14 on Debian Linux PowerPC.</para></listitem>
105       </itemizedlist>
106     </sect2>
107     
108     <sect2>
109       <title>Supported &sql; Implementation</title>
110       <para>
111         Currently, &clsql; supports the following databases:
112       </para>
113       <itemizedlist mark="opencircle">
114         <listitem><para>&mysql; v3.23.51.</para></listitem>
115         <listitem><para>&postgresql; v7.2 with both direct API and TCP socket connections.</para></listitem>
116         <listitem><para>Allegro's ODBC interface (&aodbc;) using iODBC ODBC manager.</para></listitem>
117       </itemizedlist>
118     </sect2>
119     
120   </sect1>
121   
122   <sect1 id="installation">
123     <title>Installation</title>
124     
125     <sect2>
126       <title>Ensure &asdf; is loaded</title>
127       <para>
128         Simply load the file <filename>asdf.lisp</filename>.
129         <screen>
130 (load "asdf.lisp")
131         </screen>
132       </para>
133     </sect2>
134     
135     <sect2>
136       <title>Build &c; helper libraries</title>
137       <para>&clsql; uses functions that require 64-bit integer
138         parameters and return values. The &ffi; in most &clsql;
139         implementations do not support 64-bit integers. Thus, C helper
140         libraries are required to break these 64-bit integers into two compatible
141         32-bit integers. The helper libraries reside in the directories
142         <filename>uffi/</filename> and <filename>db-mysql</filename>.
143       </para>
144       
145       <sect3>
146         <title>&mswindows;</title>
147         <para>
148           Files named <filename>Makefile.msvc</filename> are supplied
149           for building the libraries under Microsoft Windows.  Since
150           &mswindows; does not come with that compiler, compiled
151           <type>DLL</type> and <type>LIB</type> library files are
152           supplied with &clsql;.
153         </para>
154       </sect3>
155
156       <sect3>
157         <title>&unix;</title>
158         <para>
159           Files named <filename>Makefile</filename> are supplied for building the libraries
160           under &unix;. However, the <filename>.asd</filename> automatically invoke
161           the makefiles when necessary. So, manual building of the helper libraries
162           is not necessary on &unix;.
163         </para>
164       </sect3>
165       
166     </sect2>
167     
168     <sect2>
169       <title>Load &uffi;</title>
170       <para>
171         Unzip or untar the &uffi; distribution which creates a directory
172         for the &uffi; files. Add that directory to &asdf;'s <varname>asdf:*central-registry*</varname>.
173         You can do that by pushing the pathname of the directory onto this variable.
174         The following example code assumes the &uffi; files reside in the
175         <filename>/usr/share/lisp/uffi/</filename> 
176         directory.
177         <screen>
178 (push #P"/usr/share/lisp/uffi/" asdf:*central-registry*)
179 (asdf:operate 'asdf:load-op :uffi)
180         </screen>
181       </para>
182     </sect2>
183    <sect2>
184      <title>Load &md5; module</title>
185      <para>
186        If you plan to use the  clsql-postgresql-socket interface, you must load the md5 module.
187        Unzip or untar the cl-md5 distribution, which creates a directory for the cl-md5 files.
188        Add that directory to &asdf;'s <varname>asdf:*central-registry*</varname>. 
189        You can do that by pushing the pathname of the directory onto this variable.
190         The following example code assumes the cl-md5 files reside in the
191        <filename>/usr/share/lisp/cl-md5/</filename> 
192        directory.
193        <screen>
194 (push #P"/usr/share/lisp/cl-md5/" asdf:*central-registry*)
195 (asdf:operate 'asdf:load-op :md5)
196        </screen>
197      </para>
198    </sect2>
199    
200    <sect2>
201      <title>Load &clsql; modules</title>
202      <para>
203        Unzip or untar the &clsql; distribution which creates a directory
204        for the &clsql; files. Add that directory to &asdf;'s <varname>asdf:*central-registry*</varname>.
205        You can do that by pushing the pathname of the directory onto this variable.
206        The following example code assumes the &clsql; files reside in the
207        <filename>/usr/share/lisp/clsql/</filename> 
208        directory. You need to load, at a minimum,
209        the main <symbol>:clsql</symbol> system and at least one interface system.
210         <screen>
211 (push #P"/usr/share/lisp/clsql/" asdf:*central-repository*)
212 (asdf:operate 'asdf:load-op 'clsql-base)        ; base clsql package
213 (asdf:operate 'asdf:load-op 'clsql-mysql)       ; MySQL interface
214 (asdf:operate 'asdf:load-op 'clsql-postgresql)  ; PostgreSQL interface
215 (asdf:operate 'asdf:load-op 'clsql-postgresql-socket) ; Socket PGSQL interface
216 (asdf:operate 'asdf:load-op 'clsql-aodbc)       ; Allegro ODBC interface
217 (asdf:operate 'asdf:load-op 'clsql)             ; main clsql package
218         </screen>
219       </para>
220     </sect2>
221     
222     <sect2>
223       <title>Run test suite</title>
224       <para>
225         After loading &clsql;, you can execute the test suite. A configuration
226         file named <filename>.clsql-test.config</filename> must be created
227         in your home directory. There are instructures on the format of that file
228         in the <filename>tests/tests.lisp</filename> file in the &clsql;
229         source directory. After creating that file, you can run the test suite
230         with &asdf;:
231         <screen>
232           (asdf:operate 'asdf:test-op 'clsql)
233         </screen>
234       </para>
235     </sect2>
236     
237   </sect1>
238
239 </chapter>
240