Skip to main content

Module database

Module database 

Source
Expand description

Access to the SQLite database embedded in .clip files (and .cmc / .sut, which are plain SQLite files).

CSP creates tables and columns only when a file first needs them, so readers look columns up by name and treat missing ones as absent.

Structs§

Row
One row read with SELECT *, columns in table order.

Enums§

SqlValue
Owning dynamic type value. Value’s type is typically dictated by SQLite (not by the caller).

Functions§

columns
Column (name, declared type) pairs of a table, in order.
has_column
Whether table has a column named column.
has_table
Same as table_exists.
open_bytes
Open a database image as an in-memory connection (changes stay in memory).
quote
Quote an identifier for SQL.
select
Run a query and return its rows with column names.
select_all
Every row of a table (empty when the table does not exist).
serialize
The database image of connection (what goes into CHNKSQLi).
table_exists
Whether the database has a table with this name.
tables
Names of all tables, in creation order.
value_as_text
Read an id column that CSP stores either as TEXT or as BLOB.