Skip to main content

radixdb_sql/ast/
mod.rs

1// Copyright 2026 RadixDB Contributors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Abstract syntax tree contracts for RadixDB SQL.
16
17use crate::token::{Position, Token, TokenType};
18use radixdb_core::{CompactArc, ForeignKeyAction, SmartString, Value, ValueSet};
19use rustc_hash::{FxHashMap, FxHashSet};
20use std::fmt;
21
22mod control;
23mod ddl;
24mod dml;
25mod expression;
26mod procedural;
27mod query;
28mod security;
29mod source;
30mod statement;
31mod visitor;
32
33pub use control::*;
34pub use ddl::*;
35pub use dml::*;
36pub use expression::*;
37pub use procedural::*;
38pub use query::*;
39pub use security::*;
40pub use source::*;
41pub use statement::*;
42pub use visitor::{
43    walk_expression_tree, walk_expression_tree_mut, walk_physical_table_sources, walk_select_tree,
44    walk_select_tree_mut, walk_statement_physical_table_sources, walk_statement_tree,
45    walk_statement_tree_mut,
46};
47
48#[cfg(test)]
49mod tests;
50
51fn escape_sql_string(value: &str) -> String {
52    value.replace('\'', "''")
53}