Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

sql.sqlite

import sql.sqlite

sql does not re-export this module, so it is reached only by importing it directly.

The SQLite adapter.

SQLite is a database that is a file. There is no server to run, no port to open and no user to create, which is what makes it the right choice for an application that ships with its data, a test suite that wants a real database per run, and anything that would otherwise have invented a file format of its own.

Reach it through sql, which is what makes the same program work against another engine later:

import sql

var db = sql.open('sqlite://./app.db')

The module underneath is here for the parts of SQLite that have no equivalent anywhere else: incremental blob access, online backup, functions and collations written in Zuri, and the hooks that report what the engine is doing.

Submodules

ModuleReached asSummary
sql.sqlite.backupsql.sqlite.backup.*Copying a live SQLite database without stopping it.
sql.sqlite.blobsql.sqlite.blob.*Reading and writing a single blob-valued cell a piece at a time.
sql.sqlite.connectionsql.sqlite.connection.*A SQLite connection, as the layer above the adapters sees one.
sql.sqlite.cursorsql.sqlite.cursor.*Reading a SQLite result one row at a time.
sql.sqlite.driversql.sqlite.driver.*Opening SQLite databases: reading a connection string, choosing the open flags, and putting a new connection…
sql.sqlite.errorssql.sqlite.errors.*Turning SQLite’s result codes into the shared error classes.
sql.sqlite.schemaimport sql.sqlite.schemaIntrospection for SQLite, which answers through pragmas rather than through catalogue tables.
sql.sqlite.statementsql.sqlite.statement.*A SQLite statement compiled once and run many times.
sql.sqlite.typessql.sqlite.types.*Reading SQLite values back as the types a column was declared to hold.

Constants

DRIVER

sql.sqlite.DRIVER

The driver instance sql registers for this engine.

A driver holds no state of its own, so one serves every connection.

Functions

connect()

sql.sqlite.connect(dsn) -> SqliteConnection

Opens a SQLite database directly, without going through sql.

Useful when a program has settled on SQLite and wants the adapter’s own extras without the indirection. Anything meant to stay portable should use sql.open() instead.

Parameters

  • dsn (string|dict) — A path, a sqlite: string, or options.

Returns SqliteConnection


2026, Richard Ore and Zuri contributors