Home Expressions
Docs
Drivers Gateway SDKs Benchmarks
Changelog
GitHub
Blog Status Roadmap

The AST Data Protocol

One Typed AST. Infinite Possibilities.

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.

1 Unified AST Shared contract from application down to the driver
Instant APIs Auto-REST, WebSockets, and powerful SDKs
Bare-Metal Zero-overhead Rust and pure-Zig native drivers
Rust cargo install qail
Zig 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.

Live Query Shape Protocol path overview
QAIL AST
Qail::get("users")
    .select_all()
    .filter("active", Eq, true)
encode + bind
POSTGRESQL SELECT * FROM users WHERE active = $1
QDRANT { "must": [{ "key": "active", "match": true }] }
RustRust ZigZig

Ecosystem Overview

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.

qail.rs

Rust Core Platform

The full multi-entry AST pipeline, featuring parser, policy, PostgreSQL, Qdrant, and HTTP/WebSocket gateways.

qail-zig

Zig Native Driver

Pure Zig PostgreSQL driver with AST builders, transparent pooling, pipeline execution, TLS, COPY, and LSP support.

performance metrics

Transparent Benchmarks

Reproducible, verifiable benchmarks organized by subsystem and tracked meticulously over time.

Benchmark Highlight

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.

Core Architecture

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.

qail.rs Platform

Shared Core Runtime

The full orchestration layer: qail-core, qail-pg, vector search, API gateway, and schema-driven RLS policy validation.

qail-zig Runtime

Native Zig Track

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.

qail-core

qail.rs Core Engine

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

qail-pg

qail.rs PostgreSQL Driver

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?

qdrant

qail.rs Vector Driver

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?

qail-gateway

qail.rs API Runtime

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

Every Entry Point → One Pipeline

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.

REST Adapter
GET /api/users?active=true
Text Adapter
get users where active = true
Binary Adapter
postcard::to_allocvec(&cmd)
Normalized AST
Qail { action: Get, table: "users", cages: [Filter(active = true)] }
Policy + Validation Stage
rewrite: active = true AND tenant_id = $ctx.tenant_id
Planner + Encoder Stage
compile AST to driver-specific protocol frames and typed bind values
PostgreSQL Driver Path
Parse / Bind / Execute
Qdrant Driver Path
Filter + Vector Search RPC

Supported Databases

The qail.rs core platform targets two production databases with one typed AST, plus built-in cache for hot paths.

PostgreSQL

PostgreSQL

Relational • Transactions • ACID

Production
Qdrant

Qdrant

Vector • AI/ML • Semantic Search

Production

QAIL Vector Driver →

Native Cache

Moka • TTL • Zero Latency

Built-in

Official SDK Integrations

Integrate 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.

PostgreSQL drivers → Gateway page → SDK page →

Migration Guardrails and Safety Checks

Deterministic migration execution with policy validation, signed receipts, and explicit unsafe override controls.

migration-check.log
$ qail migrate down --target 20260324 --wait-for-lock

ABORTED: guardrail violation

check.non_tty_confirmation = failed
check.receipt_signature    = failed
check.schema_drift         = passed

next_step: verify receipt integrity and rerun with --force --confirm <token>

Static Query Impact Scan

Parses `.rs`, `.ts`, `.js`, and `.py` sources to detect references to columns affected by a migration.

Exact Diagnostic Output

Emits file and line-level diagnostics so affected call-sites can be fixed before migration execution.

Explicit Override Path

Requires --force plus maintainer confirmation before bypassing failed guardrails.

The data layer you don't write.

One AST. Protocol bytes. Compile-time safety. Built-in RLS.