Up: cl-sqlite   [Contents][Index] cl-sqlite Usage

  1. Connect

    connects to the database


    disconnects from the database


    macro that opens the database and ensures that it is properly closed after the code is run

  2. Queries

    macro is used to execute code within transaction.

    Support for ITERATE is provided

    This clause will bind vars (a list of variables) to the values of the columns of query.

    (for (vars) in-sqlite-query sql on-database db &optional with-parameters (&rest parameters))

    Positional and named parameters in queries are supported. Positional parameters are denoted by question mark in SQL code, and named parameters are denoted by prefixing color (:), at sign (@) or dollar sign ($) before parameter name.

  3. Prepared Statement API

    Additionally, it is possible to use the prepared statements API of sqlite. Create the prepared statement with prepare-statement, bind its parameters with bind-parameter, step through it with step-statement, retrieve the results with statement-column-value, and finally reset it to be used again with reset-statement or dispose of it with finalize-statement.

  4. Supported Types

    Following types are supported:

    • Integer. Integers are stored as 64-bit integers.
    • Float. Stored as double. Single-float, double-float and rational may be passed as a parameter, and double-float will be returned.
    • String. Stored as an UTF-8 string.
    • Vector of bytes. Stored as a blob.
    • Null. Passed as NIL to and from database.