Expand description
A typed read client for the Daml Participant Query Store (PQS, served by Scribe).
PQS streams a participant’s contracts into Postgres and exposes them through
a small set of functions — active, creates, archives, exercises,
lookup_contract. This crate reads them typed: a query names its template
by type, and the row comes back as the generated payload.
§No hand-written SQL, and no interpolation
Predicates compile to parameterized statements. Every caller-supplied value
is a parameter, and so is every JSON field path — sent as text[] and
applied with #>. The statement text depends on the shape of a query and
never on its data, so a field name taken from user input is data Postgres
never parses.
§The payload is the same type the Ledger API gives you
PQS stores payloads in the Daml JSON encoding, which is what canton-daml
implements — so a contract read here deserializes into the same generated
type as one read from a transaction stream. That is the point of the crate:
two ways in, one set of types.
Structs§
- Contract
- A contract as PQS holds it: the typed payload, plus the ledger facts about it.
- Exercise
- An exercised choice as PQS holds it.
- PqsClient
- A read client for a PQS database.
- Predicate
- One condition on a contract’s payload or on its row.
- Query
- A query over one template, compiled to parameterized SQL.
- Sql
- A compiled statement: SQL with
$nplaceholders, and the values for them.
Enums§
- Op
- How a value is compared.
- Param
- A parameter, in the form
tokio-postgreswill bind it. - Source
- Which PQS function a query reads from.
Constants§
- DEFAULT_
TIMEOUT - How long a connection attempt or a single query may take before it is
reported as
Error::Timeoutinstead of left hanging. SeePqsClient::with_timeout.
Traits§
- Into
Path - Anything that names a path into the payload.
Functions§
- active_
signed_ by - Convenience: the active contracts of a template that a party signs.