SQLite version 3
Prev | Appendix A. Database Back-ends | Next

## SQLite version 3

### Libraries

The SQLite version 3 back-end requires the SQLite version 3 shared library file. Its default file name is `/usr/lib/libsqlite3.so`.

### Initialization

Use

    (asdf:operate 'asdf:load-op 'clsql-sqlite3)

to load the SQLite version 3 back-end. The database type for the SQLite version 3 back-end is :sqlite3.

### Connection Specification

#### Syntax of connection-spec

    (filename &optional init-function)

#### Description of connection-spec

`filename`

  String representing the filename of the SQLite version 3 database file.

`init-function`

  A function designator. `init-function` takes a single argument of type sqlite3:sqlite3-db, a foreign pointer to the C descriptor of the newly opened database. `init-function` is called by the back-end immediately after SQLite version 3 `sqlite3_open` library function, and can be used to perform optional database initializations by calling foreign functions in the SQLite version 3 library.

  An example of an initialization function which defines a new collating sequence for text columns is provided in `./examples/sqlite3/init-func/`.

### Notes

#### Connection

- Passing `filename` a value of `:memory:` will create a database in physical memory instead of using a file on disk.

- Some operations will be many times faster if database integrity checking is disabled by setting the SYNCHRONOUS flag to OFF (see the SQLITE manual for details).

#### FDDL

- The :owner keyword argument to the FDDL functions for listing and testing for database objects is ignored.

- The :column-list keyword argument to `create-view` is not supported by SQLite version 3.

#### Symbolic SQL Syntax

- SQLite version 3 does not support the `all`, `some`, `any` and `exists` subquery operations.

Prev | Up | Next
SQLite version 2 | Home | Oracle