Expand description
pond_sql_query: read-only DataFusion SQL over the three Lance tables
(sessions / messages / parts), registered as LanceTableProviders
(behind plan-time views that rename id to message_id / session_id)
on a fresh per-call SessionContext. Read-only is enforced in two layers - a
single-SELECT pre-parse and sql_with_options with DDL/DML/statements all
disabled - so no statement that mutates the corpus or touches the filesystem
(INSERT/UPDATE/DELETE/CREATE/DROP/COPY/CREATE EXTERNAL TABLE/SET) can run.
Results render inline (row-capped) or export to a parquet/ndjson file the
caller fetches via the pond-sql-export:// resource (src/transport.rs).
Structs§
- Tables
- The Lance datasets a query references, fetched fresh per call so each query
sees a current snapshot (the handle freshness gate runs on each
Store::dataset). A field isNonewhen the query never names that table - the caller skips opening it, avoiding the slowparts.lanceopen on the common messages-only query (spec.md#search). Seementions_table.
Enums§
- Format
- Export serialization format. Vector columns are excluded and JSON columns
are decoded to text before encoding (see [
displayable]). - Mode
- How
pond_sql_queryreturns results. - Outcome
- Result of a successful
run. - SqlError
- Two error channels:
Queryis caller-fixable (parse/plan/exec/limits) and the tool surfaces it as anisErrorresult so the model self-corrects;Infrais an internal failure surfaced as a protocol error.
Constants§
- DEFAULT_
INLINE_ ROWS - Default inline row cap when the caller passes no
limit. - MAX_
INLINE_ ROWS - Upper bound on the caller-supplied inline
limit.
Functions§
- mentions_
table - Whether
sqlreferences the table namedtable. A DataFusion query can only reach a registered table by writing its name literally - no alias hides the base name - so this lowercase word-boundary scan never yields a false negative. At worst it matches the name inside a string or column literal and opens a table the query won’t touch: a cheap, safe false positive. Lets the caller open only the datasets a query needs. - run
- Execute one read-only SQL query and return either a rendered table, a JSON payload, or encoded export bytes.