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">
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>
28 <screen>(mk:load-system :clsql-mysql)</screen>
29 to load the MySQL back-end. The database type for the MySQL
30 back-end is <symbol>:mysql</symbol>.</para>
33 <title>Connection Specification</title>
35 <title>Syntax of connection-spec</title>
36 <synopsis>(<replaceable>host</replaceable> <replaceable>db</replaceable> <replaceable>user</replaceable> <replaceable>password</replaceable>)</synopsis>
39 <title>Description of connection-spec</title>
42 <term><parameter>host</parameter></term>
44 <para>String representing the hostname or IP address
45 the MySQL server resides on, or <symbol>nil</symbol>
46 to indicate the localhost.</para>
50 <term><parameter>db</parameter></term>
52 <para>String representing the name of the database on
53 the server to connect to.</para>
57 <term><parameter>user</parameter></term>
59 <para>String representing the user name to use for
60 authentication, or <symbol>nil</symbol> to use the
61 current Unix user ID.</para>
65 <term><parameter>password</parameter></term>
67 <para>String representing the unencrypted password to
68 use for authentication, or <symbol>nil</symbol> if
69 the authentication record has an empty password
78 <sect1 id="postgresql">
79 <title>PostgreSQL</title>
81 <title>Libraries</title>
82 <para>The PostgreSQL back-end needs access to the PostgreSQL C
83 client library (<filename>libpq.so</filename>). The
84 location of this library is specified via
85 <symbol>*postgresql-so-load-path*</symbol>, which defaults
86 to <filename>/usr/lib/libpq.so</filename>. Additional flags
87 to <application>ld</application> needed for linking are
88 specified via <symbol>*postgresql-so-libraries*</symbol>,
89 which defaults to <symbol>("-lcrypt" "-lc")</symbol>.</para>
92 <title>Initialization</title>
94 <screen>(mk:load-system :clsql-postgresql)</screen>
95 to load the PostgreSQL back-end. The database type for the
96 PostgreSQL back-end is <symbol>:postgresql</symbol>.</para>
99 <title>Connection Specification</title>
101 <title>Syntax of connection-spec</title>
102 <synopsis>(<replaceable>host</replaceable> <replaceable>db</replaceable> <replaceable>user</replaceable> <replaceable>password</replaceable> &optional <replaceable>port</replaceable> <replaceable>options</replaceable> <replaceable>tty</replaceable>)</synopsis>
105 <title>Description of connection-spec</title>
106 <para>For every parameter in the connection-spec,
107 <symbol>nil</symbol> indicates that the PostgreSQL default
108 environment variables (see PostgreSQL documentation) will
109 be used, or if those are unset, the compiled-in defaults
110 of the C client library are used.</para>
113 <term><parameter>host</parameter></term>
115 <para>String representing the hostname or IP address
116 the PostgreSQL server resides on. Use the empty
117 string to indicate a connection to localhost via
118 Unix-Domain sockets instead of TCP/IP.</para>
122 <term><parameter>db</parameter></term>
124 <para>String representing the name of the database on
125 the server to connect to.</para>
129 <term><parameter>user</parameter></term>
131 <para>String representing the user name to use for
132 authentication.</para>
136 <term><parameter>password</parameter></term>
138 <para>String representing the unencrypted password to
139 use for authentication.</para>
143 <term><parameter>port</parameter></term>
145 <para>String representing the port to use for
146 communication with the PostgreSQL server.</para>
150 <term><parameter>options</parameter></term>
152 <para>String representing further runtime options for
153 the PostgreSQL server.</para>
157 <term><parameter>tty</parameter></term>
159 <para>String representing the tty or file to use for
160 debugging messages from the PostgreSQL server.</para>
168 <sect1 id="postgresql-socket">
169 <title>PostgreSQL Socket</title>
171 <title>Libraries</title>
172 <para>The PostgreSQL Socket back-end needs
173 <emphasis>no</emphasis> access to the PostgreSQL C
174 client library, since it communicates directly with the
175 PostgreSQL server using the published frontend/backend
176 protocol, version 2.0. This eases installation and makes it
177 possible to dump CMU CL images containing CLSQL and this
178 backend, contrary to backends which require FFI code.</para>
181 <title>Initialization</title>
183 <screen>(mk:load-system :clsql-postgresql-socket)</screen>
184 to load the PostgreSQL Socket back-end. The database type for the
185 PostgreSQL Socket back-end is
186 <symbol>:postgresql-socket</symbol>.</para>
189 <title>Connection Specification</title>
191 <title>Syntax of connection-spec</title>
192 <synopsis>(<replaceable>host</replaceable> <replaceable>db</replaceable> <replaceable>user</replaceable> <replaceable>password</replaceable> &optional <replaceable>port</replaceable> <replaceable>options</replaceable> <replaceable>tty</replaceable>)</synopsis>
195 <title>Description of connection-spec</title>
198 <term><parameter>host</parameter></term>
200 <para>If this is a string, it represents the hostname or
201 IP address the PostgreSQL server resides on. In
202 this case communication with the server proceeds via
203 a TCP connection to the given host and port.</para>
205 If this is a pathname, then it is assumed to name the
206 directory that contains the server's Unix-Domain
207 sockets. The full name to the socket is then
208 constructed from this and the port number passed,
209 and communication will proceed via a connection to
210 this unix-domain socket.</para>
214 <term><parameter>db</parameter></term>
216 <para>String representing the name of the database on
217 the server to connect to.</para>
221 <term><parameter>user</parameter></term>
223 <para>String representing the user name to use for
224 authentication.</para>
228 <term><parameter>password</parameter></term>
230 <para>String representing the unencrypted password to
231 use for authentication. This can be the empty
232 string if no password is required for
233 authentication.</para>
237 <term><parameter>port</parameter></term>
239 <para>Integer representing the port to use for
240 communication with the PostgreSQL server. This
241 defaults to 5432.</para>
245 <term><parameter>options</parameter></term>
247 <para>String representing further runtime options for
248 the PostgreSQL server.</para>
252 <term><parameter>tty</parameter></term>
254 <para>String representing the tty or file to use for
255 debugging messages from the PostgreSQL server.</para>
266 <title>Libraries</title>
267 <para>The AODBC back-end requires access to the ODBC interface
271 <title>Initialization</title>
273 <screen>(mk:load-system :clsql-aodbc)</screen>
274 to load the MySQL back-end. The database type for the AODBC
275 back-end is <symbol>:aodbc</symbol>.</para>
278 <title>Connection Specification</title>
280 <title>Syntax of connection-spec</title>
281 <synopsis>(<replaceable>dsn</replaceable> <replaceable>user</replaceable> <replaceable>password</replaceable>)</synopsis>
284 <title>Description of connection-spec</title>
287 <term><parameter>dsn</parameter></term>
289 <para>String representing the ODBC data source name.</para>
293 <term><parameter>user</parameter></term>
295 <para>String representing the user name to use for
296 authentication.</para>
300 <term><parameter>password</parameter></term>
302 <para>String representing the unencrypted password to
303 use for authentication.</para>