Skip to main content

Crate no_mistakes_postgres_engine

Crate no_mistakes_postgres_engine 

Source
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::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::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§

CanonicalOrderKey
PostgresFactError
Path-aware extractor failure. Extractors return this instead of panicking.
PostgresParseError
Parse failure for PostgreSQL SQL. Never panics.
PostgresSchemaOptions
Options for selecting SQL schema files. There is no hardcoded migrations root.
SqlAddColumnMetadata
One ALTER TABLE … ADD COLUMN.
SqlAssignmentFact
One SET/VALUES assignment classified without keeping the sqlparser AST.
SqlBareRead
A bare column that a subquery reads, with the base tables that could own it.
SqlBoundFact
One executed SELECT, UPDATE or DELETE, reduced to its row-count facts. Key uniqueness is determined later against the schema catalog.
SqlBoundItem
One FROM item and the columns or index expressions the statement pins on it.
SqlBoundOutput
Syntactic value provenance for one projected column, independent of query row cardinality.
SqlBoundPin
A conjunct that equates one column or index expression of an item with a value.
SqlBoundQuery
A query body: its FROM items, and whether it caps its own row count.
SqlColumnMetadata
Column facts later generated-column and lock-ordering rules can query.
SqlColumnUseFact
A bare column reference resolved to a base relation when possible.
SqlConflictWhereProof
Conjunctive no-op proofs on ON CONFLICT … WHERE.
SqlConjunctFact
SqlCountExistenceFact
A scalar COUNT(*) comparison testing presence or absence of matching rows.
SqlCreateIndexMetadata
One CREATE INDEX or unique/primary-key covering index.
SqlCreateTableMetadata
One CREATE TABLE after PostgreSQL dialect parsing.
SqlDeclaredIdentifier
A name introduced by one migration statement, unquoted and schema-unqualified.
SqlDropIndexMetadata
One DROP INDEX so later migrations can remove earlier creates.
SqlExistsSetOpFact
An EXISTS whose subquery uses a set operation.
SqlForeignKeyMetadata
One foreign key from CREATE TABLE or ALTER TABLE.
SqlIndexParam
One key column of a btree index, including opclass and sort options.
SqlInsertFact
One executed INSERT recovered from PostgreSQL SQL.
SqlLimitFact
One LIMIT / FETCH FIRST row cap, at the position of its count.
SqlNamedConstraint
A named constraint add or VALIDATE CONSTRAINT.
SqlOnConflictFact
ON CONFLICT action recovered from an INSERT.
SqlQualifiedRead
A schema-qualified reference which did not match a relation name syntactically.
SqlQualifiedScope
Candidate relations in one lexical query scope for a qualified read.
SqlRelationPredicateFact
One base-table instance and the columns a predicate constrains on it.
SqlScalarReads
Local bare-column candidates and known enclosing relations for an independent scalar read.
SqlSchemaFileFacts
Schema facts for one SQL file read through SourceStore.
SqlSelectFact
One SELECT that names relations in FROM/JOIN.
SqlSettingUse
A syntactically recoverable PostgreSQL parameter change.
SqlStatementFileFacts
Statement facts for one SQL source (file or embedded call).
SqlStatementKind
One schema-level statement kind recorded from PostgreSQL SQL.
SqlSweepFact
A limited SELECT over 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.
SqlTriggerFact
One CREATE TRIGGER.
SqlUnanalyzableStatement
One SQL chunk that lenient parsing recovered partially or could not recover.
SqlUnnamedConstraint
An unnamed ALTER TABLE ADD FOREIGN KEY or CHECK.
SqlWriteFact
One syntactic INSERT, UPDATE, or MERGE write, independent of any catalog.

Enums§

SqlBoundInputMode
How inputs determine a query’s returned rows.
SqlBoundItemKind
SqlBoundKind
Which statement a bound fact judges.
SqlColumnClause
Where a bare column reference was used.
SqlConflictArbiter
SqlCursorBound
The direction of a cursor comparison: id > $1 bounds id from below, id < $1 from above. A range (id >= $1 AND id < $2) has both, which narrows the walk.
SqlLimitValue
SqlOnConflictAction
SqlPinSource
SqlTableSchemaEvent
Ordered table catalog changes, retaining qualified and decoded last-component identities.
SqlTriggerEvent
SqlTriggerPeriod
SqlValueForm
SqlWriteColumns
TriggerEvent

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 sql with the PostgreSQL dialect.