Skip to main content

Crate fireweed_dsl_postgres

Crate fireweed_dsl_postgres 

Source
Expand description

PostgreSQL executor for Fireweed’s data-plane DSL (API-008).

apply_schema creates a space’s tables and indexes from its schema. execute runs a program as one transaction of plain SQL statements over those tables. sweep writes back time-driven state and deletes what retention has expired.

These are functions over a connection. They keep nothing in the process between calls: each call reads the space’s schema from the database, checks the program against it, and runs it. Queries are sent unprepared with text parameters (query_typed), so each costs one round trip.

Structs§

Swept
What one sweep pass changed.

Constants§

CATALOG
Objects shared by every space. Idempotent; run under the catalog lock.

Functions§

apply_schema
Creates a space, or changes its schema (API-008 §Changing a schema). expected is the version the caller expects to replace: None for a new space.
execute
Runs a program as one transaction (API-008 §Transactions).
execute_batch
Runs independent programs in one space as one transaction with one commit (API-008 §Batches). Each program runs under its own savepoint, so one that fails or rejects leaves the others alone; each gets its own result, in order. A program that hits a deadlock is run again.
get_schema
The stored schema of a space, if it exists.
sweep
Writes back time-driven state and deletes what retention has expired, at most batch rows per object (API-008 §Time). Rows other transactions hold are skipped.