Skip to main content

Module query

Module query 

Source

Structs§

CompiledQuery
The output of a successful PyQL compilation. Immutable and safe to cache and reuse across requests.
ExecutionMetadata
Timing and result facts about one query execution.
JsonMember
One member’s decode plan within a jsonb-backed tuple value (ShapeNode::NamedTuple.members) — recursive so a member can itself be a nested tuple.
ShapeDescriptor
Opaque handle to the output shape of a compiled query.

Enums§

Cardinality
ErrorClass
A coarse bucket for a failed query, for use as a metric label.
InferencePlan
Pre-execution inference plan — set when the query requires an external model call before the SQL can be executed. Python switches on the variant.
JsonMemberKind
Outcome
Whether a query succeeded, and if not, how it failed.
QueryParam
Typed query parameter value produced during compilation.
ShapeNode
Internal tree describing one position in the query output shape. Opaque to Python — only the Rust deserializer inspects it.

Functions§

clear_query_cache
Discard all cached compiled queries. Call when the schema is reloaded.
compile
Compile a PyQL query string to SQL against schema, using default session config (see ir::SessionConfig) — for schema-time/test callers with no live client-supplied config. compile_with_config is the real entry a query request uses.
compile_fill_expr
Compile a PyQL expression string in the context of a named type to a bare SQL expression suitable for use in an UPDATE SET clause.
compile_script
Every statement of a script, compiled in the order written.
compile_trigger_handler
Compile a schema Trigger’s handler PyQL statement (e.g. insert Note { note := __new__.name }) to a full SQL statement, for embedding in the generated plpgsql trigger function body — see ir::compile_trigger_handler for the __new__/__old__ row-context binding rules. on_mask is Pylon’s On bitmask (1=Insert, 2=Update, 4=Delete), matching TriggerDescriptor::on. Query parameters ($name) are rejected, same rule as compile_fill_expr — a trigger handler has no caller to supply them.
compile_with_config
Like compile, but honors a caller-supplied SessionConfig for this query.
derive_shape_id
The shape id for a given SQL string and result shape — the derivation compile_uncached uses to populate CompiledQuery::shape_id, exposed so anything else constructing a CompiledQuery by hand can fill that field consistently rather than inventing its own value.