Skip to main content

Module postgres

Module postgres 

Source
Expand description

PostgreSQL in-DB SQL-on-FHIR runner.

PgInDbRunner compiles a ViewDefinition to a parameterised PostgreSQL SELECT statement and executes it directly against the resources table, bypassing in-process FHIRPath evaluation entirely.

§Streaming

Rows are fetched lazily via tokio_postgres::Client::query_raw and sent through a bounded tokio::sync::mpsc channel (buffer: 256) so the HTTP layer can begin flushing before the full result set has been transferred. The async fetch loop runs in a tokio::spawn task that holds the pooled connection open until the consumer drops the receiver.

Structs§

PgInDbRunner
SQL-on-FHIR runner that compiles ViewDefinitions to PostgreSQL SQL.