Expand description
PostgreSQL embedded SQL extraction, schema catalog, and replay-safety engine.
Re-exports§
pub use catalog::canonical_key;pub use catalog::catalog_finding;pub use catalog::expression_matches;pub use catalog::order_prefix_matches;pub use catalog::require_catalog_path;pub use catalog::AllowEntry;pub use catalog::AllowList;pub use catalog::CanonicalIndex;pub use catalog::CatalogCheck;pub use catalog::CatalogColumn;pub use catalog::CatalogCoverage;pub use catalog::CatalogEnum;pub use catalog::CatalogForeignKey;pub use catalog::CatalogFunction;pub use catalog::CatalogIndexInfo;pub use catalog::CatalogIndexKey;pub use catalog::CatalogObjectRef;pub use catalog::CatalogRowSecurity;pub use catalog::CatalogTable;pub use catalog::CatalogTrigger;pub use catalog::CatalogUnique;pub use catalog::CatalogView;pub use catalog::GeneratedKind;pub use catalog::PartitionKey;pub use catalog::PartitionKeyElement;pub use catalog::PartitionStrategy;pub use catalog::PolicyCommand;pub use catalog::RelationKind;pub use catalog::ResolvedArbiter;pub use catalog::SchemaCatalog;pub use catalog::TriggerTiming;pub use embedded::executed_query_text;pub use embedded::executor_bindings;pub use embedded::extract_embedded_sql_from_program;pub use embedded::extract_embedded_sql_from_source;pub use embedded::is_database_call;pub use embedded::sql_text;pub use embedded::summarize_undeclared_executor_types;pub use embedded::EmbeddedSqlCall;pub use embedded::EmbeddedSqlFileFacts;pub use embedded::EmbeddedSqlFragment;pub use embedded::EmbeddedSqlKind;pub use embedded::EmbeddedSqlOptions;pub use embedded::EmbeddedSqlSourcePosition;pub use embedded::EmbeddedSqlVariant;pub use embedded::SqlByteOrigins;pub use embedded::SqlIdentifierAssertion;pub use embedded::TrustedSqlTag;pub use embedded::UndeclaredExecutorType;pub use embedded::UndeclaredExecutorTypeSummary;pub use embedded::MAX_EMBEDDED_SQL_VARIANTS;pub use embedded::MAX_FROZEN_OBJECT_SQL_VARIANTS;pub use on_conflict::judge_file;pub use on_conflict::Catalog as IdempotentCatalog;pub use options::ExecutorOption;pub use statements::extract_sql_statement_facts_for_embedded_call;pub use types::PostgresFacts;pub use verdict::SqlBranchJudgment;pub use verdict::SqlEvidenceKind;pub use verdict::SqlObligationVerdict;pub use verdict::SqlRuleApplication;pub use verdict::SqlVerdictStatus;
Modules§
- catalog
- embedded
- embedded_
dml - Projection of embedded SQL call facts into SQL statement facts.
- executor_
detachment - hooks
- Inverted runtime hooks for
no-mistakes-postgres-engine. - lock_
inventory - on_
conflict - ON CONFLICT replay-safety judgments over statement facts.
- options
- statements
- types
- verdict
- view_
bounds
Structs§
- Canonical
Order Key - Postgres
Fact Error - Path-aware extractor failure. Extractors return this instead of panicking.
- Postgres
Parse Error - Parse failure for PostgreSQL SQL. Never panics.
- Postgres
Schema Options - Options for selecting SQL schema files. There is no hardcoded migrations root.
- SqlAdd
Column Metadata - One
ALTER TABLE … ADD COLUMN. - SqlAssignment
Fact - One SET/VALUES assignment classified without keeping the sqlparser AST.
- SqlBare
Read - A bare column that a subquery reads, with the base tables that could own it.
- SqlBound
Fact - One executed SELECT, UPDATE or DELETE, reduced to its row-count facts. Key uniqueness is determined later against the schema catalog.
- SqlBound
Item - One FROM item and the columns or index expressions the statement pins on it.
- SqlBound
Output - Syntactic value provenance for one projected column, independent of query row cardinality.
- SqlBound
Pin - A conjunct that equates one column or index expression of an item with a value.
- SqlBound
Query - A query body: its FROM items, and whether it caps its own row count.
- SqlColumn
Metadata - Column facts later generated-column and lock-ordering rules can query.
- SqlColumn
UseFact - A bare column reference resolved to a base relation when possible.
- SqlConflict
Where Proof - Conjunctive no-op proofs on
ON CONFLICT … WHERE. - SqlConjunct
Fact - SqlCount
Existence Fact - A scalar
COUNT(*)comparison testing presence or absence of matching rows. - SqlCreate
Index Metadata - One
CREATE INDEXor unique/primary-key covering index. - SqlCreate
Table Metadata - One
CREATE TABLEafter PostgreSQL dialect parsing. - SqlDeclared
Identifier - A name introduced by one migration statement, unquoted and schema-unqualified.
- SqlDrop
Index Metadata - One
DROP INDEXso later migrations can remove earlier creates. - SqlExists
SetOp Fact - An
EXISTSwhose subquery uses a set operation. - SqlForeign
KeyMetadata - One foreign key from
CREATE TABLEorALTER TABLE. - SqlIndex
Param - One key column of a btree index, including opclass and sort options.
- SqlInsert
Fact - One executed
INSERTrecovered from PostgreSQL SQL. - SqlLimit
Fact - One
LIMIT/FETCH FIRSTrow cap, at the position of its count. - SqlNamed
Constraint - A named constraint add or
VALIDATE CONSTRAINT. - SqlOn
Conflict Fact ON CONFLICTaction recovered from an INSERT.- SqlQualified
Read - A schema-qualified reference which did not match a relation name syntactically.
- SqlQualified
Scope - Candidate relations in one lexical query scope for a qualified read.
- SqlRelation
Predicate Fact - One base-table instance and the columns a predicate constrains on it.
- SqlScalar
Reads - Local bare-column candidates and known enclosing relations for an independent scalar read.
- SqlSchema
File Facts - Schema facts for one SQL file read through
SourceStore. - SqlSelect
Fact - One
SELECTthat names relations in FROM/JOIN. - SqlSetting
Use - A syntactically recoverable PostgreSQL parameter change.
- SqlStatement
File Facts - Statement facts for one SQL source (file or embedded call).
- SqlStatement
Kind - One schema-level statement kind recorded from PostgreSQL SQL.
- SqlSweep
Fact - A limited
SELECTover one base table, ordered by plain columns of that table: the shape of a page of a keyset walk. Only the WHERE conjuncts decide whether the walk is selective. - SqlTrigger
Fact - One
CREATE TRIGGER. - SqlUnanalyzable
Statement - One SQL chunk that lenient parsing recovered partially or could not recover.
- SqlUnnamed
Constraint - An unnamed
ALTER TABLE ADDFOREIGN KEY or CHECK. - SqlWrite
Fact - One syntactic INSERT, UPDATE, or MERGE write, independent of any catalog.
Enums§
- SqlBound
Input Mode - How inputs determine a query’s returned rows.
- SqlBound
Item Kind - SqlBound
Kind - Which statement a bound fact judges.
- SqlColumn
Clause - Where a bare column reference was used.
- SqlConflict
Arbiter - SqlCursor
Bound - The direction of a cursor comparison:
id > $1boundsidfrom below,id < $1from above. A range (id >= $1 AND id < $2) has both, which narrows the walk. - SqlLimit
Value - SqlOn
Conflict Action - SqlPin
Source - SqlTable
Schema Event - Ordered table catalog changes, retaining qualified and decoded last-component identities.
- SqlTrigger
Event - SqlTrigger
Period - SqlValue
Form - SqlWrite
Columns - Trigger
Event
Functions§
- extract_
sql_ statement_ facts - Extract INSERT/SELECT/trigger facts from one SQL source.
- has_
top_ level_ not_ exists_ in - Whether SQL contains a top-level conjunctive NOT EXISTS predicate.
- insert_
keyword_ count - mask_
quoted_ sql - Mask comments, quoted strings, and dollar-quoted bodies in one scan so comment markers inside literals and quotes inside comments cannot nest.
- parse_
postgres_ expression - Parse a standalone PostgreSQL expression via
SELECT <expression>. - parse_
postgres_ sql - Parse
sqlwith the PostgreSQL dialect.