Query an .odb database
odb_queryRun a read-only SQL query against an embedded .odb database's tables in memory, using a supported SELECT grammar or a saved query name; unsupported constructs return explicit errors instead of being ignored.
Instructions
Runs a bounded single-table SELECT over an embedded .odb database's own extracted tables, given directly as SQL or by naming one of the database's saved queries. No database engine is involved -- the query runs in memory over the same tables odb_tables would return, against a closed grammar (SELECT/WHERE/GROUP BY/ORDER BY, no joins or subqueries); an unsupported construct is reported as a tool error naming it, never silently ignored.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | No | A literal SELECT statement to run. Mutually exclusive with "query". | |
| query | No | The name of one of the .odb's own saved queries to run. Mutually exclusive with "sql". | |
| source | Yes | .odb database to read. 'path' points at the .odb file on disk -- its extension is never used to infer a document format, since documents.js deliberately excludes 'odb' from DocumentFormat (an embedded database front end has no single natural target format -- tables, saved queries, and reports are three unrelated output shapes -- see that package's own README). 'bytesBase64' carries the .odb bytes inline; its 'format' field is required by the shared hybrid input shape but unused by every odb tool. |