Installation

Ensure Defsystem is loaded

Simply load the file defsystem.lisp.

(load "defsystem.lisp")
        

Build C helper libraries

CLSQL uses functions that require 64-bit integer parameters and return values. The FFI in most CLSQL implementations do not support 64-bit integers. Thus, C helper libraries are required to break these 64-bit integers into two compatible 32-bit integers.

Makefiles for Microsoft Windows and GNU/Solaris systems are supplied to build the libraries. Since many Microsoft Windows users don't have access to a compiler, the DLL and LIB files for Microsoft Windows are supplied with the distribution.

To build the libraries on a GNU or Solaris, use the shell and change to the root directory of CLSQL. You may need to edit the file interfaces/mysql/Makefile to specify the location of your MySQL installation. The default Makefiles are setup for shared library linking on Linux. If you are using FreeBSD or Solaris, you will need to change the linker setting as instructed in the Makefile. Then, you can give the command

make libs
in the root directory of CLSQL to build the libraries interfaces/mysql/clsql-mysql.so and interfaces/clsql-uffi/clsql-uffi.so.

Load UFFI

Unzip or untar the UFFI distribution which creates a directory for the UFFI files. Add that directory to Defsystem's mk:*central-registry*. You can do that by either pushing the pathname of the directory onto this variable, or use the new add-registry-location present in the newest versions of Defsystem. The following example code assumes the UFFI files reside in the /usr/local/src/lisp/uffi directory.

(mk:add-registry-location #P"/usr/local/src/lisp/uffi")
(mk:load-system :uffi)
        

Load CLSQL modules

Unzip or untar the CLSQL distribution which creates a directory for the CLSQL files. Add that directory to Defsystem's mk:*central-registry*. You can do that by either pushing the pathname of the directory onto this variable, or use the new add-registry-location present in the newest versions of Defsystem. The following example code assumes the CLSQL files reside in the /usr/local/src/lisp/clsql directory. You need to load, at a minimum, the main :clsql system and at least one interface system.

(mk:add-registry-location #P"/usr/local/src/lisp/clsql")
(mk:load-system :clsql)              ; main clsql package
(mk:load-system :clsql-mysql)       ; MySQL interface
(mk:load-system :clsql-postgresql)  ; PostgreSQL interface
(mk:load-system :clsql-postgresql-socket) ; Socket PGSQL interface
(mk:load-system :clsql-aodbc)       ; Allegro ODBC interface
        

Run test suite

After loading CLSQL, you can execute the test program in the directory ./test-suite. The test file, tester-clsql has instructions for creating a test.config. After creating that file, simple load the test file with Lisp and the tests should automatically execute.