CL-DBI

Database independent interface for Common Lisp

View the Project on GitHub fukamachi/cl-dbi

Usage

(defvar *connection*
    (dbi:connect :mysql
                 :database-name "test"
                 :username "nobody"
                 :password "1234"))

(let ((query (dbi:prepare *connection*
               "SELECT * FROM somewhere WHERE flag = ? OR updated_at > ?"))
      (result (dbi:execute query 0 "2011-11-01")))
  (loop for row = (dbi:fetch result)
        while row
        ;; process "row".
        ))

Description

CL-DBI is intended to provide the same interface for each database.

Not only, you don't have to learn each API of databases anymore, but this layer is especially convenient when you want to use the different database by environment.

For example, your application had better to use efficient database such as MySQL on the production environment, but you may want to use SQLite3 on your machine. In that case, all what you have to do is only to rewrite calling dbi:connect.

Databases

Installation

This library will be available on Quicklisp when ready to use.

API

User-Level API

Driver-Level API

Creating a new driver

Create a subclass of <dbi-driver> and implement following methods.

And these methods may be overrided if needed.

Dependencies

Author

Copyright

Copyright (c) 2011 Eitarow Fukamachi (e.arrows@gmail.com)

License

Licensed under the LLGPL License.