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
Parametersresource toLibrary.parameterdeclarations, 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
Parametersbody for a$sql-runwhose subject is a SQLQuery or SQLView Library. - scan
- Pure, conservative scanner over SQL text: the
:nameplaceholders a query uses and the tables itsFROM/JOINclauses read, each located by line, column, and Unicode-character offset/length (#841, #842).
Enums§
- SqlQuery
Error - Errors produced by the
$sqlquery-runpipeline.