Skip to main content

Module sqlquery

Module sqlquery 

Source
Expand description

SQL-on-FHIR v2 $sqlquery-run engine.

Pure execution logic: parse a SQLQuery Library, materialize its depends-on ViewDefinitions into an in-memory SQLite database, bind Library.parameter values to the SQL, run the user query, and format the rows.

The REST handler in helios-rest wires this to storage (resolving Library / ViewDefinition resources and supplying RowStreams from the wired SofRunner); this module contains no storage or HTTP concerns.

Re-exports§

pub use bind::BINDABLE_PARAMETER_TYPES;
pub use bind::BoundParam;
pub use bind::bind_supplied_params;
pub use engine::ColumnFhirType;
pub use engine::InMemorySqlEngine;
pub use engine::QueryResult;
pub use engine::TableSchema;
pub use library::DependsOnView;
pub use library::LibraryParameter;
pub use library::SqlQueryLibrary;
pub use library::parse_sqlquery_library;
pub use output::format_fhir_parameters;
pub use params::SqlQueryRunParams;
pub use params::extract_sqlquery_params_from_json;
pub use scan::Placeholder;
pub use scan::ScanError;
pub use scan::ScanResult;
pub use scan::SourcePosition;
pub use scan::TableRef;
pub use scan::scan_sql;
pub use scan::undeclared_tables;

Modules§

bind
Bind values from a supplied Parameters resource to Library.parameter declarations, using FHIR type codes to choose the right rusqlite value.
engine
In-memory SQLite engine used by $sqlquery-run.
library
Parse a SQLQuery Library (FHIR Library profile) into the parts the engine needs: the SQL string, parameter declarations, and depends-on ViewDefinitions.
output
Output formatting for $sqlquery-run.
params
Parse the FHIR Parameters body for a $sql-run whose subject is a SQLQuery or SQLView Library.
scan
Pure, conservative scanner over SQL text: the :name placeholders a query uses and the tables its FROM/JOIN clauses read, each located by line, column, and Unicode-character offset/length (#841, #842).

Enums§

SqlQueryError
Errors produced by the $sqlquery-run pipeline.