The AST Data Protocol
QAIL keeps queries on a strictly-typed AST path from your application to the database wire. Build instantly with our AutoREST and WebSocket gateways, or leverage our ultra-fast Rust and Zig runtimes for raw database performance.
cargo install qail zig fetch --save ...qail-zig/v0.6.1.tar.gz
Official Support: Rust, Zig, TypeScript, Swift, Kotlin · Latest stable: qail.rs v0.27.2 · qail-zig v0.6.1 · View performance reports at /benchmarks.
Qail::get("users")
.select_all()
.filter("active", Eq, true) SELECT * FROM users WHERE active = $1 { "must": [{ "key": "active", "match": true }] } Choose the exact integration level your application needs. Use our robust client SDKs and gateways for rapid development, or embed our native drivers for maximum database throughput.
The full multi-entry AST pipeline, featuring parser, policy, PostgreSQL, Qdrant, and HTTP/WebSocket gateways.
Pure Zig PostgreSQL driver with AST builders, transparent pooling, pipeline execution, TLS, COPY, and LSP support.
Reproducible, verifiable benchmarks organized by subsystem and tracked meticulously over time.
qail-zig leads in isolated prepared queries and connection pooling throughput, while qail.rs dominates in massive prepared pipeline throughput. Review the full methodology and raw output in the benchmark index.
QAIL provides specialized, production-ready execution environments. qail.rs powers our multi-entry API gateways and vector integrations, while qail-zig delivers uncompromising low-level database driver performance.
The full orchestration layer: qail-core, qail-pg, vector search, API gateway, and schema-driven RLS policy validation.
Pure-Zig PostgreSQL driver engineered for throughput. Built-in pooling, pipelining, TLS, integration with COPY, and dedicated CLI/LSP tooling.
The diagram below illustrates the shared AST pipeline flowing through the qail.rs architecture.
Parser, transpiler, and type system. Queries stay as typed data structures with schema validation before runtime execution.
get users fields id, email
where active = true
order by created_at desc
limit 10 Protocol-native PostgreSQL execution path with typed bind values, RLS context propagation, and deterministic query planning.
let driver = PgDriver::connect_env().await?;
driver.fetch_all(&cmd).await? Typed vector and filter operations mapped to Qdrant RPC with one AST execution contract shared with SQL paths.
driver.search_points(&cmd).await?;
driver.filter_points(&cmd).await? HTTP and WebSocket surface over the same AST path, with policy checks, FK expansion, and structured response shaping.
GET /api/bookings
?status.eq=confirmed
&sort=created_at:desc
&expand=routes,payments
&limit=20 Request adapters cleanly normalize REST parameters, text DSL expressions, and binary payloads into one strictly-typed AST. Validation, policy enforcement, query planning, and wire encoding all securely run through the same unified pipeline before database dispatch.
GET /api/users?active=true get users where active = true postcard::to_allocvec(&cmd) Qail { action: Get, table: "users", cages: [Filter(active = true)] } rewrite: active = true AND tenant_id = $ctx.tenant_id compile AST to driver-specific protocol frames and typed bind values Parse / Bind / Execute Filter + Vector Search RPC The qail.rs core platform targets two production databases with one typed AST, plus built-in cache for hot paths.
Relational • Transactions • ACID
ProductionMoka • TTL • Zero Latency
Built-inIntegrate effortlessly using our official drivers and client SDKs. We provide robust, type-safe tooling for Rust, Zig, TypeScript, Swift, and Kotlin out of the box.
Deterministic migration execution with policy validation, signed receipts, and explicit unsafe override controls.
Parses `.rs`, `.ts`, `.js`, and `.py` sources to detect references to columns affected by a migration.
Emits file and line-level diagnostics so affected call-sites can be fixed before migration execution.
Requires --force plus maintainer confirmation before bypassing failed guardrails.
One AST. Protocol bytes. Compile-time safety. Built-in RLS.