The ODBC back-end requires access to an ODBC driver manager as well as ODBC drivers for the underlying database server. CLSQL has been tested with unixODBC ODBC Driver Manager as well as Microsoft's ODBC manager. These driver managers have been tested with the psqlODBC driver for PostgreSQL and the MyODBC driver for MySQL.
Use
(asdf:operate 'asdf:load-op 'clsql-odbc)
to load the ODBC back-end. The database type for the ODBC back-end is :odbc.
dsnString representing the ODBC data source name.
userString representing the user name to use for authentication.
passwordString representing the unencrypted password to use for authentication.
connection-stringRaw connection string passed to the underlying ODBC driver. Allows bypassing creating a DSN on the server.
;; 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.