X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=doc%2Fappendix.xml;h=f06f035edfd4915831a7004018c66e278f0f6f46;hb=31ca29efddf77e342aa180dfd2d2e292f6055530;hp=a37c582a9459f1f2e012c45df0ac0f2d07a39f0f;hpb=d529146041f6265030edc25c735e063ebfdbd285;p=clsql.git diff --git a/doc/appendix.xml b/doc/appendix.xml index a37c582..f06f035 100644 --- a/doc/appendix.xml +++ b/doc/appendix.xml @@ -7,14 +7,53 @@ Database Back-ends - - - PostgreSQL - - Libraries - The PostgreSQL back-end requires the PostgreSQL C - client library (libpq.so). The - location of this library is specified via + + + How CLSQL finds and loads foreign libraries + + For some database types CLSQL has to load external foreign + libaries. These are usually searched for in the standard + locations the operating system uses but you can tell &clsql; to + look into other directories as well by using the function + CLSQL:PUSH-LIBRARY-PATH or by directly + manipulating the special variable + CLSQL:*FOREIGN-LIBRARY-SEARCH-PATHS*. If, + say, the shared library libpq.so needed for PostgreSQL support + is located in the directory /opt/foo/ on + your machine you'd use + + (clsql:push-library-path "/opt/foo/") + + before loading the CLSQL-POSTGRESQL module. (Note the trailing + slash above!) + + If you want to combine this with fully automatic loading of + libraries via ASDF a technique like the following works: + + + (defmethod asdf:perform :after ((o asdf:load-op) + (c (eql (asdf:find-system 'clsql)))) + (funcall (find-symbol (symbol-name '#:push-library-path) + (find-package 'clsql)) + #p"/opt/foo/")) + + + + + Additionally, site-specific initialization can be done using an +initialization file. If the file /etc/clsql-init.lisp +exists, this file will be read after the &clsql; ASDF system is loaded. +This file can contain forms to set site-specific paths as well as change +&clsql; default values. + + + + PostgreSQL + + Libraries + The PostgreSQL back-end requires the PostgreSQL C + client library (libpq.so). The + location of this library is specified via *postgresql-so-load-path*, which defaults to /usr/lib/libpq.so. Additional flags to ld needed for linking are @@ -240,7 +279,7 @@ Connection Specification Syntax of connection-spec - (host db user password) + (host db user password &optional port) Description of connection-spec @@ -277,6 +316,13 @@ field. + + port + + String representing the port to use for + communication with the MySQL server. + + @@ -392,7 +438,7 @@ Connection Specification Syntax of connection-spec - (dsn user password) + (dsn user password &key connection-string) Description of connection-spec @@ -417,6 +463,15 @@ use for authentication. + + connection-string + + Raw connection string passed to the underlying + ODBC driver. Allows bypassing creating a DSN on the + server. + + + @@ -432,6 +487,26 @@ + Connect Examples + + +;; assumes a "mssql" DSN is configured on the lisp host, specifying database server +;; and database name. +> (clsql:connect '("mssql" "database-user" "database-password") + :database-type :odbc) +=> #<CLSQL-ODBC:ODBC-DATABASE mssql/database-user OPEN {100756D123}> + +;; no DSN on the lisp host, specify connection information via :connection-string +> (clsql:connect '("friendly-server-name" "friendly-username" "" + :connection-string "DRIVER={FreeTDS};SERVER=mssql-server;DATABASE=database-name;UID=database-user;PWD=database-password;PORT=1433;TDS_Version=8.0;APP=clsql") + :database-type :odbc) +=> #<CLSQL-ODBC:ODBC-DATABASE friendly-server-name/friendly-username OPEN {100756D123}> + + The friendly-server-name + and friendly-username are only used when + printing the connection object to a stream. + + @@ -525,8 +600,8 @@ filename - String representing the filename of the &sqlite; - database file. + String or pathname representing the filename of + the &sqlite; database file.