[package]
name = "qail-core"
version = "0.24.6"
edition = "2024"
description = "AST-native query builder - type-safe expressions, zero SQL strings"
license = "Apache-2.0"
repository = "https://github.com/qail-io/qail"
readme = "README.md"
categories = ["database", "parser-implementations"]
keywords = ["qail", "sql", "parser"]

[features]
default = []
syn-scanner = ["dep:syn", "dep:proc-macro2"]
analyzer = ["syn-scanner", "dep:sqlparser", "dep:quote", "dep:regex"]
# Internal-only: enables examples that depend on external crates (qail-pg, bytes).
# Never used in normal builds — only for manual `cargo run --example`.
_pg_examples = []

[dependencies]
nom = "8"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "2"
chrono = { version = "0.4", features = ["serde"] }
uuid = { version = "1", features = ["serde", "v4", "js"] }
strsim = "0.11"
toml = "1.0"

# Analyzer-only: SQL-to-QAIL refactoring tool
syn = { version = "2", features = ["full", "visit", "parsing"], optional = true }
proc-macro2 = { version = "1", features = ["span-locations"], optional = true }
sqlparser = { version = "0.60.0", optional = true }
quote = { version = "1.0.45", optional = true }
regex = { version = "1.10", optional = true }

[dev-dependencies]
proptest = "1.10.0"

[[example]]
name = "test_multiline_sql"
required-features = ["analyzer"]

# This example depends on qail-pg (external crate); gated behind _pg_examples
# so it is excluded from `cargo test -p qail-core`.
[[example]]
name = "test_subquery_sql2"
required-features = ["_pg_examples"]

[lints]
workspace = true
