kumosql-sql 0.1.0

BigQuery/GoogleSQL lexer, parser, AST, printer, formatter, complexity scoring, read-only validation, Dataform SQLX handling and script analysis for KumoSQL-Rust
Documentation
//! BigQuery / GoogleSQL language support for KumoSQL-Rust.
//!
//! * [`token`]: the lexer (strings, raw/bytes prefixes, quoted names, numbers, comments, operators).
//! * [`ast`]: the syntax tree, with traversal helpers.
//! * [`parser`]: a recursive-descent parser for statements, queries, pipe syntax and expressions.
//! * [`printer`]: a deterministic printer whose output parses back to an equal tree.
//! * [`formatting`]: the formatter (comments kept, meaning checked) and structural complexity scoring.
//! * [`validation`]: the read-only query check and strict table path quoting.
//! * [`sqlx`]: Dataform SQLX sections, config blocks, interpolation masking and restoring.
//! * [`scripts`]: BigQuery script splitting and data-flow analysis (temp tables, variables, MERGE, procedures).
//! * [`js`]: plain data read out of Dataform JavaScript without running it.

pub mod ast;
pub mod error;
pub mod formatting;
pub mod js;
pub mod parser;
pub mod printer;
pub mod scripts;
pub mod sqlx;
pub mod token;
pub mod validation;

pub use ast::*;
pub use error::{Result, SqlError};
pub use formatting::{complexity, format_sql, Complexity, ComplexityBand, FormatPreferences};
pub use parser::{
    parse_data_type, parse_expr, parse_query, parse_script, parse_statement, parse_statements,
};
pub use printer::{expr_to_sql, query_to_sql, to_sql, to_sql_compact};
pub use scripts::{analyse_script, split_script, ScriptAnalysis, ScriptStatement};
pub use sqlx::{
    decode_sqlx_bytes, looks_like_sqlx, mask_sqlx, parse_sqlx_config, restore_sqlx,
    split_sqlx_sections, MaskedSqlx, RefCall, SqlxConfig, SqlxSection,
};
pub use token::{tokenize, tokenize_with_trivia, Span, Token, TokenKind};
pub use validation::{quote_table_path, validate_readonly_query, validate_readonly_query_with_max};