Expand description
Query executors — evaluate parsed SQL statements against the in-memory storage and produce formatted output.
Structs§
- Select
Result - Executes a parsed
SelectQueryagainst the database and returns a human-readable rendering of the result set (prettytable). Also returns the number of rows produced, for the top-level status message. Structured result of a SELECT: column names in projection order, and each matching row as aVec<Value>aligned with the columns. Phase 5a introduced this so the publicConnection/StatementAPI has typed rows to yield; the existingexecute_selectthat returns pre-rendered text is now a thin wrapper on top.
Functions§
- eval_
predicate - Returns
trueif the row atrowidmatches the predicate expression. - execute_
alter_ table - Executes
ALTER TABLE [IF EXISTS] <name> <op>;for one operation per statement. Supports four sub-operations matching SQLite: - execute_
create_ index - Handles
CREATE INDEX [UNIQUE] <name> ON <table> [USING <method>] (<column>). Single-column indexes only. - execute_
delete - Executes a DELETE statement. Returns the number of rows removed.
- execute_
drop_ index - Executes
DROP INDEX [IF EXISTS] <name>;. The statement does not name a table, so we walk every table looking for the index across all three index families (B-Tree secondary, HNSW, FTS). - execute_
drop_ table - Executes
DROP TABLE [IF EXISTS] <name>;. Mirrors SQLite’s single-target shape: sqlparser parsesDROP TABLE a, bas one statement withnames: vec![a, b], but we reject the multi-target form to keep error semantics simple (no partial-failure rollback). - execute_
select - Executes a SELECT and returns
(rendered_table, row_count). The REPL and Tauri app use this to keep the table-printing behaviour the engine has always shipped. Structured callers useexecute_select_rowsinstead. - execute_
select_ rows - Executes a SELECT and returns structured rows. The typed rows are
what the new public API streams to callers; the REPL / Tauri app
pre-render into a prettytable via
execute_select. - execute_
update - Executes an UPDATE statement. Returns the number of rows updated.
- execute_
vacuum - Executes
VACUUM;(SQLR-6). Compacts the database file: rewrites every live table, index, and the catalog contiguously from page 1, drops the freelist, and truncates the tail at the next checkpoint.