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

AST Builder API (Recommended)

Build queries as typed Rust structs. No app-side SQL string interpolation on this path.

PostgreSQL still does normal parse/plan/execute on the server.

Select all users Qail::get("users") .select_all()
Wire Protocol Output SELECT * FROM users
Filter with conditions Qail::get("users") .columns(["id", "email"]) .filter("active", Eq, true) .order_by("created_at", Desc) .limit(10)
Wire Protocol Output SELECT id, email FROM users WHERE active = true ORDER BY created_at DESC LIMIT 10
Insert with returning Qail::add("users") .columns(["email", "name"]) .values(["alice_at_example.com", "Alice"]) .returning_all()
Wire Protocol Output INSERT INTO users (email, name) VALUES ('alice_at_example.com', 'Alice') RETURNING *
Join tables Qail::get("users") .columns(["name", "avatar"]) .left_join("profiles", "users.id", "profiles.user_id")
Wire Protocol Output SELECT name, avatar FROM users LEFT JOIN profiles ON users.id = profiles.user_id

Text Syntax (CLI, LSP, WASM)

Human-readable syntax for developer tools. Parses to AST internally.

Select all users get users fields *
Transpiled SQL SELECT * FROM users
Filter with conditions get users fields id, email where active = true order by created_at desc limit 10
Transpiled SQL SELECT id, email FROM users WHERE active = true ORDER BY created_at DESC LIMIT 10
Fuzzy search get users fields id, name where name ilike john
Transpiled SQL SELECT id, name FROM users WHERE name ILIKE '%john%'

AST Builder vs Others

QAIL is not only a faster driver path. It also collapses common backend plumbing because the query intent, bind values, tenant context, and expansion rules are already structured data.

Feature Raw SQL ORMs Query Builders QAIL AST
String-free
Injection-Safe AST Path ✕ (via .raw())
Repository Layer Required Usually Usually Usually Optional
Tenant Context as Query Data Manual Manual / middleware Manual
Wire Protocol Direct
Multi-Database
Type-Safe End-to-End