Appendix A. Database Back-ends

Table of Contents

How CLSQL finds and loads foreign libraries
PostgreSQL
Libraries
Initialization
Connection Specification
Notes
PostgreSQL Socket
Libraries
Initialization
Connection Specification
Notes
MySQL
Libraries
Initialization
Connection Specification
Notes
ODBC
Libraries
Initialization
Connection Specification
Notes
AODBC
Libraries
Initialization
Connection Specification
Notes
SQLite version 2
Libraries
Initialization
Connection Specification
Notes
SQLite version 3
Libraries
Initialization
Connection Specification
Notes
Oracle
Libraries
Library Versions
Initialization
Connection Specification
Notes

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.