Documentation
¶
Overview ¶
Package sqlite implements a verify.Verifier backed by an in-memory modernc.org/sqlite database. It prepares each query against the catalog schema and reports per-column origin metadata via the driver's ColumnInfo extension.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PlanRow ¶
PlanRow holds a single row returned by EXPLAIN QUERY PLAN. SQLite returns four columns (id, parent, notused, detail); notused is discarded. Detail describes the access method chosen for each step of the plan, e.g. "SCAN users" or "SEARCH users USING INDEX idx_users_email".
type Verifier ¶
type Verifier struct{}
Verifier is a SQLite verify.Verifier.
func (*Verifier) ExplainPlan ¶
func (v *Verifier) ExplainPlan(ctx context.Context, catalog *model.Catalog, sql string) ([]PlanRow, error)
ExplainPlan loads the catalog DDL on a fresh in-memory connection, then runs EXPLAIN QUERY PLAN against sql and returns the resulting rows. The query itself is never executed — only the plan is obtained. On a SQLite prepare/query error the error is returned and the caller decides whether it is fatal.
func (*Verifier) Verify ¶
func (v *Verifier) Verify(ctx context.Context, catalog *model.Catalog, queries []verify.Query) ([]verify.Result, error)
Verify opens an in-memory SQLite database, loads the catalog DDL, and prepares each query to extract column-origin metadata. One Result is returned per input query, in the same order. ParamCount is always 0 because modernc's NumInput() returns -1 and the internal count is unexported (params stay static in the Overlay).