Expand description
Classify SQL plans by database, session, and transaction effects.
Modules§
- read_
only - SQL commands forbidden by read-only transactions and snapshot-setting rules.
- transaction_
blocks - Transaction commands that require an explicit SQL block.
Structs§
- Query
Effect Context - Compose SQL definitions with the effects of planner rewrites and the embedded graph language.
Traits§
- Query
Effect Catalog - Read-only definitions required to classify plan effects before execution.
Functions§
- command_
payload_ may_ write_ database - Detect database-writing expressions and query sources embedded in an otherwise legal temporary-table DML command.
- is_
transaction_ control - query_
may_ mutate_ engine - SELECT is not synonymous with read-only: UQA exposes a small set of state-changing scalar functions, and SQL/PLpgSQL routines invoked from a projection can contain commands. Classify those plans before choosing the transaction mode so memory execution takes a rollback snapshot and
SQLiteopens a write transaction. Cloning the plan is bounded by query size and avoids the database-sized deep copy paid by a full memory snapshot. - query_
may_ write_ database - Classify only database writes forbidden by
PostgreSQLread-only transactions. Session-local effects such asrandom()andsetseed()still require statement rollback bookkeeping but remain legal in read-only mode. - query_
requires_ statement_ transaction - Some read-only operations still need a statement transaction. In particular, a PL/pgSQL block with an
EXCEPTIONarm opens a subtransaction even when neither branch writes data.