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">
8 <appendix id="appendix">
9 <title>Database Back-ends</title>
14 <title>Libraries</title>
15 <para>The MySQL back-end needs access to the MySQL C
16 client library (<filename>libmysqlclient.so</filename>).
17 The location of this library is specified
18 via <symbol>*mysql-so-load-path*</symbol>, which defaults
19 to <filename>/usr/lib/libmysqlclient.so</filename>.
20 Additional flags to <application>ld</application> needed for
21 linking are specified via <symbol>*mysql-so-libraries*</symbol>,
22 which defaults to <symbol>("-lc")</symbol>.
26 <title>Initialization</title>
30 (asdf:operate 'asdf:load-op 'clsql-mysql)
32 to load the MySQL back-end. The database type for the MySQL
33 back-end is <symbol>:mysql</symbol>.
37 <title>Connection Specification</title>
39 <title>Syntax of connection-spec</title>
40 <synopsis>(<replaceable>host</replaceable> <replaceable>db</replaceable> <replaceable>user</replaceable> <replaceable>password</replaceable>)</synopsis>
43 <title>Description of connection-spec</title>
46 <term><parameter>host</parameter></term>
48 <para>String representing the hostname or IP address
49 the MySQL server resides on, or <symbol>nil</symbol>
50 to indicate the localhost.</para>
54 <term><parameter>db</parameter></term>
56 <para>String representing the name of the database on
57 the server to connect to.</para>
61 <term><parameter>user</parameter></term>
63 <para>String representing the user name to use for
64 authentication, or <symbol>nil</symbol> to use the
65 current Unix user ID.</para>
69 <term><parameter>password</parameter></term>
71 <para>String representing the unencrypted password to
72 use for authentication, or <symbol>nil</symbol> if
73 the authentication record has an empty password
82 <sect1 id="postgresql">
83 <title>PostgreSQL</title>
85 <title>Libraries</title>
86 <para>The PostgreSQL back-end needs access to the PostgreSQL C
87 client library (<filename>libpq.so</filename>). The
88 location of this library is specified via
89 <symbol>*postgresql-so-load-path*</symbol>, which defaults
90 to <filename>/usr/lib/libpq.so</filename>. Additional flags
91 to <application>ld</application> needed for linking are
92 specified via <symbol>*postgresql-so-libraries*</symbol>,
93 which defaults to <symbol>("-lcrypt" "-lc")</symbol>.</para>
96 <title>Initialization</title>
99 (asdf:operate 'adsf:load-op 'clsql-postgresql)
101 to load the PostgreSQL back-end. The database type for the
102 PostgreSQL back-end is <symbol>:postgresql</symbol>.</para>
105 <title>Connection Specification</title>
107 <title>Syntax of connection-spec</title>
108 <synopsis>(<replaceable>host</replaceable>
109 <replaceable>db</replaceable>
110 <replaceable>user</replaceable>
111 <replaceable>password</replaceable> &optional
112 <replaceable>port</replaceable>
113 <replaceable>options</replaceable>
114 <replaceable>tty</replaceable>)</synopsis>
117 <title>Description of connection-spec</title>
119 For every parameter in the connection-spec,
120 <symbol>nil</symbol> indicates that the PostgreSQL default
121 environment variables (see PostgreSQL documentation) will
122 be used, or if those are unset, the compiled-in defaults
123 of the C client library are used.
127 <term><parameter>host</parameter></term>
129 <para>String representing the hostname or IP address
130 the PostgreSQL server resides on. Use the empty
131 string to indicate a connection to localhost via
132 Unix-Domain sockets instead of TCP/IP.</para>
136 <term><parameter>db</parameter></term>
138 <para>String representing the name of the database on
139 the server to connect to.</para>
143 <term><parameter>user</parameter></term>
145 <para>String representing the user name to use for
146 authentication.</para>
150 <term><parameter>password</parameter></term>
152 <para>String representing the unencrypted password to
153 use for authentication.</para>
157 <term><parameter>port</parameter></term>
159 <para>String representing the port to use for
160 communication with the PostgreSQL server.</para>
164 <term><parameter>options</parameter></term>
166 <para>String representing further runtime options for
167 the PostgreSQL server.</para>
171 <term><parameter>tty</parameter></term>
173 <para>String representing the tty or file to use for
174 debugging messages from the PostgreSQL server.</para>
182 <sect1 id="postgresql-socket">
183 <title>PostgreSQL Socket</title>
185 <title>Libraries</title>
186 <para>The PostgreSQL Socket back-end needs
187 <emphasis>no</emphasis> access to the PostgreSQL C
188 client library, since it communicates directly with the
189 PostgreSQL server using the published frontend/backend
190 protocol, version 2.0. This eases installation and makes it
191 possible to dump CMU CL images containing CLSQL and this
192 backend, contrary to backends which require FFI code.</para>
195 <title>Initialization</title>
199 (asdf:operate 'asdf:load-op 'clsql-postgresql-socket)
201 to load the PostgreSQL Socket back-end. The database type
202 for the PostgreSQL Socket back-end is
203 <symbol>:postgresql-socket</symbol>.
207 <title>Connection Specification</title>
209 <title>Syntax of connection-spec</title>
210 <synopsis>(<replaceable>host</replaceable>
211 <replaceable>db</replaceable>
212 <replaceable>user</replaceable>
213 <replaceable>password</replaceable> &optional
214 <replaceable>port</replaceable>
215 <replaceable>options</replaceable>
216 <replaceable>tty</replaceable>)</synopsis>
219 <title>Description of connection-spec</title>
222 <term><parameter>host</parameter></term>
224 <para>If this is a string, it represents the hostname or
225 IP address the PostgreSQL server resides on. In
226 this case communication with the server proceeds via
227 a TCP connection to the given host and port.</para>
229 If this is a pathname, then it is assumed to name the
230 directory that contains the server's Unix-Domain
231 sockets. The full name to the socket is then
232 constructed from this and the port number passed,
233 and communication will proceed via a connection to
234 this unix-domain socket.</para>
238 <term><parameter>db</parameter></term>
240 <para>String representing the name of the database on
241 the server to connect to.</para>
245 <term><parameter>user</parameter></term>
247 <para>String representing the user name to use for
248 authentication.</para>
252 <term><parameter>password</parameter></term>
254 <para>String representing the unencrypted password to
255 use for authentication. This can be the empty
256 string if no password is required for
257 authentication.</para>
261 <term><parameter>port</parameter></term>
263 <para>Integer representing the port to use for
264 communication with the PostgreSQL server. This
265 defaults to 5432.</para>
269 <term><parameter>options</parameter></term>
271 <para>String representing further runtime options for
272 the PostgreSQL server.</para>
276 <term><parameter>tty</parameter></term>
278 <para>String representing the tty or file to use for
279 debugging messages from the PostgreSQL server.</para>
290 <title>Libraries</title>
291 <para>The AODBC back-end requires access to the ODBC interface
295 <title>Initialization</title>
299 (asdf:operate 'asdf:load-op 'clsql-aodbc)
301 to load the MySQL back-end. The database type for the AODBC
302 back-end is <symbol>:aodbc</symbol>.
306 <title>Connection Specification</title>
308 <title>Syntax of connection-spec</title>
309 <synopsis>(<replaceable>dsn</replaceable>
310 <replaceable>user</replaceable>
311 <replaceable>password</replaceable>)</synopsis>
314 <title>Description of connection-spec</title>
317 <term><parameter>dsn</parameter></term>
319 <para>String representing the ODBC data source name.</para>
323 <term><parameter>user</parameter></term>
325 <para>String representing the user name to use for
326 authentication.</para>
330 <term><parameter>password</parameter></term>
332 <para>String representing the unencrypted password to
333 use for authentication.</para>