Skip to main content

Module sqlite_tree

Module sqlite_tree 

Source
Expand description

SQLite’s resolved parse tree, as csrc/reylo_sqlite.c serializes it: what SQLite itself resolved while preparing the statement against an in-memory replay of the schema DDL.

Every member the walker always writes is required, so that one it stops writing, or spells otherwise, fails the analysis with an error naming it, where a default would read it as false, 0 or nothing: for a fact such as “on the null-extended side of a join”, the unsound answer. A member the walker writes for some objects only has #[serde(default)] and says when it is absent; where that turns on the object’s kind (a node’s op, a write’s kind), the members of each kind are required once the object is read ([Members]). A member no struct declares is refused, so the walker writes nothing the analysis does not read.

Structs§

Col
ColumnInfo
Dml
An INSERT, an UPDATE (kind update, or upsert for an upsert’s DO UPDATE) or a DELETE: each kind’s members are required by [Members], and absent from the other kinds.
From
Node
One expression node. op names the kind; op, aff, outerOn and innerOn are every node’s, and the members after them belong to some kinds only, absent from the others: [Members] requires the ones a node’s kind always has.
PublicColumn
PublicParam
SchemaError
Sel
SetItem
TableInfo
Tree
TreeError
Upsert

Constants§

TREE_VERSION
The version of the tree’s format, which the walker writes as the tree’s first member (REYLO_TREE_VERSION in csrc/reylo_sqlite.c): a tree of another is refused, by both numbers, before anything in it is read. A change to what either side reads or writes moves both.

Functions§

analyze
Prepares sql against the schema ddl inside the embedded SQLite and returns what it resolved. functions are the host’s own scalar functions, by name and argument count (-1 for any): the replay registers a stub for each, so a statement that calls one prepares. host is every function the host’s SQLite has, when the host could list them: the replay registers a stub for one the embedded build has no function of that name for, and the prepare refuses a call to one the embedded build has and the host does not. sent is the statement as the application runs it, whose text names the columns.
version
The version of the embedded SQLite, as 3.53.4: the one that prepares every statement the engine types, whichever SQLite reads the database file or runs the statement.

Type Aliases§

Listed
A function the host’s SQLite lists (pragma_function_list): its name, its argument count as SQLite keeps it (-1 for any number) and its kind, s for a scalar, a for an aggregate, w for a window function.