Skip to main content

Module sql

Module sql 

Source
Expand description

The sans-IO contract between oxilite and a SQLite-compatible engine.

oxilite never talks to SQLite directly. Every operation produces Requests (lists of SQL statements) and consumes Responses. A backend only has to run statements — natively through rusqlite or a dlopen’ed libsqlite3, or remotely through Cloudflare D1’s batch() API.

Structs§

Capabilities
What a backend can do. The compiler adapts SQL generation to it.
Request
A group of statements sent to the backend in one round-trip.
ResultSet
The result of one statement.
Statement
A single SQL statement. oxilite inlines all constants as SQL literals, so params is almost always empty; this sidesteps D1’s 100-bound-parameter limit.

Enums§

Mode
How a request must be executed.
SqlValue
A SQL value, the subset of SQLite storage classes oxilite uses.

Functions§

col
Reads a column from a row.
expect_len
Checks that a response has the expected number of result sets.
quote_str
Writes a SQL string literal (single quotes doubled; NUL-containing strings as hex blobs).
sql_f64
Formats a float as a SQL literal.
sql_opt_str
Formats an optional string as SQL.
sql_str
Returns a SQL string literal.
union_all
UNION ALL of several SELECTs within the backend’s compound-select limit: longer chains are nested (SELECT * FROM (a UNION ALL b …) UNION ALL …).

Type Aliases§

Response
One ResultSet per statement of the Request, in order.