Skip to main content

no_mistakes_postgres_sql/
lib.rs

1//! PostgreSQL SQL parsing, statement facts, and identifier extraction.
2
3mod fx;
4#[cfg(test)]
5pub(crate) mod test_support;
6
7pub mod annotation;
8pub mod bound_expr;
9pub mod catalog_hooks;
10pub mod conflict;
11pub mod dml;
12pub mod function_calls;
13pub mod idents;
14pub mod lock_inventory;
15pub mod locking;
16pub mod migration;
17pub mod migration_order;
18pub mod numeric_literal;
19pub mod offset;
20pub mod order;
21pub mod parse;
22pub mod predicate_normalization;
23pub mod schema;
24pub mod source;
25pub mod sql_include_policy;
26pub mod sql_names;
27pub mod star_projection;
28pub mod statement_facts;
29pub mod statements;
30pub mod types;
31
32pub use annotation::{leading_query_annotation, sql_requires_query_annotation};
33pub use bound_expr::canonical_bound_expr;
34pub use catalog_hooks::{
35    CatalogLifecycleLookup, CatalogTriggerWrite, SearchPathResolution, TriggerEvent,
36};
37pub use conflict::{
38    analyze_conflict_inserts, analyze_conflict_inserts_with_binds, expression_is_constant,
39    SqlConflictInsertFact, SqlConflictTarget, SqlInsertSourceShape, SqlPinnedJoinEquality,
40    SqlPinnedRelation, SqlPinnedSource, SqlSourceRelation,
41};
42pub use dml::{
43    extract_dml_write_targets, find_generated_column_writes, GeneratedColumnWrite, GeneratedTable,
44    GeneratedTableColumns,
45};
46pub use function_calls::{SqlFunctionCallFact, SqlFunctionClause};
47pub use locking::{
48    extract_locking_select_metadata, extract_locking_select_metadata_with_placeholders,
49    JoinEquality, LockingSelectMetadata,
50};
51pub use migration::extract_migration_facts;
52pub use offset::{
53    sql_file_offset_uses, sql_has_offset_clause, sql_offset_uses, OffsetUse, SqlOffsetFact,
54};
55pub use order::{canonical_order_keys, order_by_ascending, CanonicalOrderKey};
56pub use parse::{parse_postgres_expression, parse_postgres_sql, PostgresParseError};
57pub use schema::extract_create_table_metadata;
58pub use source::*;
59pub use sql_names::decoded_parts;
60pub use statement_facts::SqlLifecycleFacts;
61#[doc(hidden)]
62pub use statement_facts::{SqlLifecycleBatch, SqlLifecycleStep, SqlViewReads};
63pub use statements::{
64    extract_sql_statement_facts, has_top_level_not_exists_in, insert_keyword_count,
65    mask_quoted_sql, SqlAssignmentFact, SqlBareRead, SqlBoundFact, SqlBoundInputMode, SqlBoundItem,
66    SqlBoundItemKind, SqlBoundKind, SqlBoundOutput, SqlBoundPin, SqlBoundQuery, SqlColumnClause,
67    SqlColumnUseFact, SqlConflictArbiter, SqlConflictWhereProof, SqlConjunctFact,
68    SqlCountExistenceFact, SqlCursorBound, SqlExistsSetOpFact, SqlInsertFact, SqlLimitFact,
69    SqlLimitValue, SqlOnConflictAction, SqlOnConflictFact, SqlPinSource, SqlQualifiedRead,
70    SqlQualifiedScope, SqlRelationPredicateFact, SqlScalarReads, SqlSelectFact,
71    SqlStatementFileFacts, SqlSweepFact, SqlTriggerEvent, SqlTriggerFact, SqlTriggerPeriod,
72    SqlValueForm, SqlWriteColumns, SqlWriteFact,
73};
74pub use types::{
75    PostgresFactError, PostgresSchemaOptions, SqlAddColumnMetadata, SqlColumnMetadata,
76    SqlCreateIndexMetadata, SqlCreateTableMetadata, SqlDeclaredIdentifier, SqlDropIndexMetadata,
77    SqlForeignKeyMetadata, SqlIndexParam, SqlNamedConstraint, SqlSchemaFileFacts, SqlSettingUse,
78    SqlStatementKind, SqlTableSchemaEvent, SqlUnanalyzableStatement, SqlUnnamedConstraint,
79};
80#[doc(hidden)]
81pub use types::{SqlComplexQuery, SqlPolicyClause, SqlPolicyClauseUse, SqlQueryComplexity};
82
83#[doc(hidden)]
84pub mod usage;