1pub mod age_cypher;
10pub mod aggregates;
11pub mod cte_strategy;
12mod ctes;
13mod expression_shape;
14mod functions;
15mod membership;
16mod projection;
17mod source_shape;
18pub use ctes::*;
19pub use expression_shape::*;
20pub use functions::*;
21pub use membership::*;
22pub use projection::*;
23pub use source_shape::*;
24
25pub const DOC_ID_COLUMN: &str = "_doc_id";
26pub const SCORE_COLUMN: &str = "_score";
27pub const TABLE_OID_COLUMN: &str = "tableoid";
28pub const XMIN_COLUMN: &str = "xmin";
29pub const META_QUALIFIER: &str = "_meta";
30pub const META_DOC_ID_COLUMN: &str = "doc_id";
31pub const META_SCORE_COLUMN: &str = "score";
32
33#[must_use]
35pub fn is_engine_pseudo_column(column: &str) -> bool {
36 matches!(
37 column,
38 DOC_ID_COLUMN | SCORE_COLUMN | TABLE_OID_COLUMN | XMIN_COLUMN
39 )
40}
41
42pub fn expr_contains_subquery(expr: &crate::ScalarExpr) -> bool {
43 expr.contains_subquery()
44}
45
46mod bound_columns;
47mod catalog_mutation;
48pub mod graph_functions;
49mod join_using;
50pub mod table_function_arguments;
51mod table_functions;
52pub use bound_columns::*;
53pub use catalog_mutation::*;
54pub use join_using::*;
55pub use table_functions::*;
56
57pub mod volatility;
58
59pub mod sets;
60
61pub mod grouping_sets;
62
63pub mod row_count;
64
65pub mod windows;
66
67pub mod effects;
68
69pub mod partition;
70
71pub mod scalar_projection;
72pub mod source_filters;
73
74pub mod join_predicates;
75
76pub mod cte_names;
77
78pub mod rules;
79
80pub mod cte_validation;
81
82pub mod locking;
83pub mod table_locks;
84
85pub fn doc_id_value(doc_id: uqa_core::DocId) -> Result<Value, SQLError> {
86 i64::try_from(doc_id).map(Value::Int).map_err(|_| {
87 SQLError::TypeMismatch(format!("document id {doc_id} exceeds the SQL BIGINT range"))
88 })
89}
90
91use crate::SQLError;
92use uqa_core::Value;
93
94pub use projection::query_plan_output_columns;
95
96pub use projection::{select_execution_stmt, should_defer_distinct_limit};
97
98pub mod view_rewrite;
99
100pub mod privileges;
101
102pub mod view_privileges;
103
104pub mod retrieval;
105pub mod text_indexes;
106
107pub mod mutation_qualifiers;
108
109pub mod referential;
110
111pub mod foreign_keys;
112pub mod period;
113
114pub mod conflict;
115
116pub mod returning;
117
118pub mod mutation_inputs;
119
120pub mod constraint_catalog;
121
122pub mod mutation_patch;
123
124pub mod mutation_privileges;
125
126pub mod generated_values;
127pub mod key_identity;
128pub mod merge;
129pub mod view_mutation;
130
131pub mod mutation_rows;
132
133pub mod graph_commands;
134
135pub mod runtime_scalars;
136
137pub mod portals;
138
139pub mod parameters;