Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
sqlite3 module
branch: master

improve: when query contains last white-space, this make "not an erro…

…r" from libsqlite3

  => trim end of whitespace from pass-through query
latest commit f3758cf77c
Masahiro Hayashi authored


Gauche-dbd-sqlite3 is a dbd module for Gauche.


- Gauche 0.9.2 or later (
- SQLite 3.7.3 or later (

[Developing Environment]

- Gauche scheme shell, version [utf-8,pthreads], x86_64-unknown-linux-gnu
- SQLite 3.7.3, 3.7.15


  $ ./DIST gen
  $ ./configure
  $ make
  % make install

[How to use]

* Connect

** sqlite3 driver support following connect-options

  1. flags: pass to sqlite3_open_v2 with
      See more details here
  2. db   : Do not use this. Only support backward compatibility.

** Following two examples will return same result.

  (dbi-make-connection (make <sqlite3-driver>) "filename.db;flags=262144" '())
  (dbi-connect "dbi:sqlite3:filename.db;flags=262144")

  Please try URI filename if libsqlite3 support it. Refer to following instruction.

** after libsqlite3 3.7.7, support URI filenames

  1. this open "filename.db" at current-directory with on memory mode and NOMUTEX.

  (dbi-make-connection (make <sqlite3-driver>) "file:filename.db?mode=memory;flags=32768" '())

  2. this open "filename.db?mode=memory" at current directory with NOMUTEX.

  (dbi-make-connection (make <sqlite3-driver>) "filename.db?mode=memory;flags=32768" '())

* Sqlite3 specifics

[Function] sqlite3-libversion

Get libsqlite3 version as a string.

Example: "3.7.15"

[Function] sqlite3-set-timeout

Set timeout milli seconds to the connection.
Sqlite3 default behavior, make immediately error if the database is locked.

[Function] sqlite3-last-id

Get ROWID which is INSERT into the argument connection in most recently.

[Function] sqlite3-error-message

Get error message from Sqlite3

[Function] sqlite3-table-columns

Get a list of all columns from argument table.

[Function] with-transaction (may be removed future release)

Execute proc one of the started transaction.  Commit automatically
when proc is returned normally.  Rollback when proc raise error.

[Function] call-with-transaction (may be removed future release)

Same as with-transaction but proc must accept a transaction object.

[Function] dbi-tables (may be changed future release)

Get a list of tables from the argument connection.

Something went wrong with that request. Please try again.