cl-dbi

API Reference

cl-dbi

No packages.

dbd-mysql

Database driver for MySQL.

DBD.MYSQL

  • Class <DBD-MYSQL>  (<DBI-DRIVER>)
    No slots.
  • Class <DBD-MYSQL-CONNECTION>  (<DBI-CONNECTION>)
    No slots.
  • Class <DBD-MYSQL-QUERY>  (<DBI-QUERY>)
    %RESULT
    STORE   Accessor: MYSQL-USE-STORE

DBD.MYSQL.ERROR

  • Macro WITH-ERROR-HANDLER (conn &body body)

dbd-postgres

Database driver for PostgreSQL.

DBD.POSTGRES

  • Class <DBD-POSTGRES>  (<DBI-DRIVER>)
    No slots.
  • Class <DBD-POSTGRES-CONNECTION>  (<DBI-CONNECTION>)
    %MODIFIED-ROW-COUNT
    %DEALLOCATION-QUEUE
  • Class <DBD-POSTGRES-QUERY>  (<DBI-QUERY>)
    NAME
    %RESULT

dbd-sqlite3

Database driver for SQLite3.

DBD.SQLITE3

  • Class <DBD-SQLITE3>  (<DBI-DRIVER>)
    No slots.
  • Class <DBD-SQLITE3-CONNECTION>  (<DBI-CONNECTION>)
    No slots.

dbi

Database independent interface for Common Lisp

DBI

  • Function CONNECT (driver-name &rest params &key database-name &allow-other-keys)
    Open a connection to the database which corresponds to `driver-name`.
  • Function CONNECT-CACHED (&rest connect-args)
  • Macro WITH-TRANSACTION (conn &body body)
    Start a transaction and commit at the end of this block. If the evaluation `body` is interrupted, the transaction is rolled back automatically.
  • Macro WITH-CONNECTION ((conn-sym &rest rest) &body body)

Also exports

  • DBI.DRIVER:PREPARE
  • DBI.ERROR:<DBI-UNIMPLEMENTED-ERROR>
  • DBI.ERROR:<DBI-WARNING>
  • DBI.ERROR:<DBI-PROGRAMMING-ERROR>
  • DBI.ERROR:<DBI-DATABASE-ERROR>
  • DBI.DRIVER:FETCH
  • DBI.DRIVER:DISCONNECT
  • DBI.DRIVER:ROLLBACK
  • DBI.ERROR:<DBI-INTEGRITY-ERROR>
  • DBI.DRIVER:CONNECTION-DRIVER-TYPE
  • DBI.ERROR:<DBI-INTERNAL-ERROR>
  • DBI.ERROR:<DBI-NOTSUPPORTED-ERROR>
  • DBI.ERROR:<DBI-DATA-ERROR>
  • DBI.ERROR:<DBI-ERROR>
  • DBI.DRIVER:ROW-COUNT
  • DBI.DRIVER:FIND-DRIVER
  • DBI.DRIVER:COMMIT
  • DBI.ERROR:<DBI-INTERFACE-ERROR>
  • DBI.DRIVER:PING
  • DBI.DRIVER:FETCH-ALL
  • DBI.ERROR:<DBI-OPERATIONAL-ERROR>
  • DBI.DRIVER:BEGIN-TRANSACTION
  • DBI.DRIVER:LIST-ALL-DRIVERS
  • DBI.DRIVER:EXECUTE
  • DBI.DRIVER:CONNECTION-DATABASE-NAME
  • DBI.DRIVER:DO-SQL

DBI.DRIVER

  • Class <DBI-DRIVER>
    Base class for DB driver.
    No slots.
  • Class <DBI-CONNECTION>
    Base class for managing DB connection.
    AUTO-COMMIT
    DATABASE-NAME   Accessor: CONNECTION-DATABASE-NAME
    %HANDLE   Accessor: CONNECTION-HANDLE
  • Generic-Function CONNECTION-DRIVER-TYPE (conn)
  • Method CONNECTION-DRIVER-TYPE ((conn <dbi-connection>))
  • Method CONNECTION-DRIVER-TYPE ((conn <dbi-connection>))
  • Method CONNECTION-DRIVER-TYPE ((conn <dbi-connection>))
  • Generic-Function MAKE-CONNECTION (driver &key)
    Create a instance of `<dbi-connection>` for the `driver`. This method must be implemented in each drivers.
  • Method MAKE-CONNECTION ((driver <dbi-driver>) &key)
  • Method MAKE-CONNECTION ((driver <dbi-driver>) &key)
  • Method MAKE-CONNECTION ((driver <dbi-driver>) &key)
  • Generic-Function DISCONNECT (conn)
  • Method DISCONNECT ((conn <dbi-connection>))
  • Method DISCONNECT ((conn <dbi-connection>))
  • Method DISCONNECT ((conn <dbi-connection>))
  • Function FIND-DRIVER (driver-name)
    Find a driver class named as `driver-name`. `driver-name` is a string designer. Driver should be named like '<DBD-SOMETHING>' for a database 'something'.
  • Function LIST-ALL-DRIVERS
    Return a list of direct subclasses for `<dbi-driver>`.
  • Class <DBI-QUERY>
    Class that represents a prepared DB query.
    CONNECTION   Accessor: QUERY-CONNECTION
    SQL   Accessor: QUERY-SQL
    PREPARED   Accessor: QUERY-PREPARED
  • Generic-Function PREPARE (conn sql &key)
  • Method PREPARE ((conn <dbi-connection>) (sql string) &key (query-class '<dbi-query>))
    Preparing executing SQL statement and returns a instance of `<dbi-query>`. This method may be overrided by subclasses.
  • Generic-Function EXECUTE (query &rest params)
    Execute `query` with `params` and return the results.
  • Method EXECUTE ((query <dbi-query>) &rest params)
  • Method EXECUTE ((query <dbi-query>) &rest params)
  • Method EXECUTE ((query <dbi-query>) &rest params)
  • Generic-Function FETCH (query)
    Fetch the first row from `query` which is returned by `execute`.
  • Method FETCH ((query <dbi-query>))
  • Method FETCH ((query <dbi-query>))
  • Method FETCH ((query <dbi-query>))
  • Generic-Function FETCH-ALL (query)
    Fetch all rest rows from `query`.
  • Method FETCH-ALL ((query <dbi-query>))
  • Method FETCH-ALL ((query <dbi-query>))
  • Method FETCH-ALL ((query <dbi-query>))
  • Generic-Function FETCH-USING-CONNECTION (conn query)
  • Method FETCH-USING-CONNECTION ((conn <dbi-connection>) (query <dbi-query>))
  • Method FETCH-USING-CONNECTION ((conn <dbi-connection>) (query <dbi-query>))
  • Method FETCH-USING-CONNECTION ((conn <dbi-connection>) (query <dbi-query>))
  • Generic-Function DO-SQL (conn sql &rest params)
    Do preparation and execution at once. This method may be overrided by subclasses.
  • Method DO-SQL ((conn <dbi-connection>) (sql string) &rest params)
  • Method DO-SQL ((conn <dbi-connection>) (sql string) &rest params)
  • Method DO-SQL ((conn <dbi-connection>) (sql string) &rest params)
  • Generic-Function EXECUTE-USING-CONNECTION (conn query params)
    Execute `query` in `conn`. This method must be implemented in each drivers.
  • Method EXECUTE-USING-CONNECTION ((conn <dbi-connection>) (query <dbi-query>) params)
  • Method EXECUTE-USING-CONNECTION ((conn <dbi-connection>) (query <dbi-query>) params)
  • Method EXECUTE-USING-CONNECTION ((conn <dbi-connection>) (query <dbi-query>) params)
  • Generic-Function BEGIN-TRANSACTION (conn)
    Start a transaction.
  • Method BEGIN-TRANSACTION ((conn <dbi-connection>))
  • Method BEGIN-TRANSACTION ((conn <dbi-connection>))
  • Method BEGIN-TRANSACTION ((conn <dbi-connection>))
  • Method BEGIN-TRANSACTION ((conn <dbi-connection>))
    Turn `auto-commit` off automatically before starting a transaction.
  • Generic-Function COMMIT (conn)
    Commit changes and end the current transaction.
  • Method COMMIT ((conn <dbi-connection>))
  • Method COMMIT ((conn <dbi-connection>))
  • Method COMMIT ((conn <dbi-connection>))
  • Generic-Function ROLLBACK (conn)
    Rollback all changes and end the current transaction.
  • Method ROLLBACK ((conn <dbi-connection>))
  • Method ROLLBACK ((conn <dbi-connection>))
  • Method ROLLBACK ((conn <dbi-connection>))
  • Generic-Function PING (conn)
    Check if the database server is still running and the connection to it is still working.
  • Method PING ((conn <dbi-connection>))
  • Method PING ((conn <dbi-connection>))
  • Method PING ((conn <dbi-connection>))
  • Generic-Function ROW-COUNT (conn)
    Return the number of counts modified by the last executed INSERT/UPDATE/DELETE query.
  • Method ROW-COUNT ((conn <dbi-connection>))
  • Method ROW-COUNT ((conn <dbi-connection>))
  • Method ROW-COUNT ((conn <dbi-connection>))
  • Generic-Function ESCAPE-SQL (conn sql)
    Return escaped `sql`. This method may be overrided by subclasses when needed. For example, in case of MySQL and PostgreSQL, backslashes must be escaped by doubling it.
  • Method ESCAPE-SQL ((conn <dbi-connection>) (sql string))
  • Method ESCAPE-SQL ((conn <dbi-connection>) (sql string))
  • Method ESCAPE-SQL ((conn <dbi-connection>) (sql string))

DBI.ERROR

  • Condition <DBI-ERROR>  (SIMPLE-ERROR)
    Base class of all other error exceptions. Use this to catch all DBI errors.
  • Condition <DBI-WARNING>  (SIMPLE-WARNING)
    For important warnings like data truncation, etc.
  • Condition <DBI-INTERFACE-ERROR>  (<DBI-ERROR>)
    Exception for errors related to the DBI interface rather than the database itself.
  • Condition <DBI-UNIMPLEMENTED-ERROR>  (<DBI-INTERFACE-ERROR>)
    Exception raised if the DBD driver has not specified a mandatory method.
  • Condition <DBI-DATABASE-ERROR>  (<DBI-ERROR>)
    Exception for errors related to the database.
  • Condition <DBI-DATA-ERROR>  (<DBI-DATABASE-ERROR>)
    Exception for errors due to problems with the processed data such as division for zero, numeric value out of range, etc.
  • Condition <DBI-OPERATIONAL-ERROR>  (<DBI-DATABASE-ERROR>)
    Exception for errors related to the database's operation which are not necessarily under the control of the programmer. This includes such things as unexpected disconnect, datasource name not found, transaction could not be processed, a memory allocation error occured during processing, etc.
  • Condition <DBI-INTEGRITY-ERROR>  (<DBI-DATABASE-ERROR>)
    Exception raised when the relational integrity of the database is affected, e.g. a foreign key check fails.
  • Condition <DBI-INTERNAL-ERROR>  (<DBI-DATABASE-ERROR>)
    Exception raised when the database encounters an internal error, e.g. the cursor is not valid anymore, the transaction is out of sync.
  • Condition <DBI-PROGRAMMING-ERROR>  (<DBI-DATABASE-ERROR>)
    Exception raised for programming errors, e.g. table not found or already exists, syntax error in SQL statement, wrong number of parameters specified, etc.
  • Condition <DBI-NOTSUPPORTED-ERROR>  (<DBI-DATABASE-ERROR>)
    Exception raised if e.g. commit() is called for a database which do not support transactions.

dbi-test

DBI.TEST

  • Function RUN-DRIVER-TESTS (driver-name &rest params)