HomePlaygroundExpressionsDocsDriversBlogStatusRoadmapChangelog GitHub

AST Builder API (Recommended)

Build queries as typed Rust structs. No parsing. No strings.

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@example.com", "Alice"]) .returning_all()
Wire Protocol Output INSERT INTO users (email, name) VALUES ('alice@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

Feature Raw SQL ORMs Query Builders QAIL AST
String-free โœ• โœ• โœ• โœ“
Injection Impossible โœ• โœ• (via .raw()) โœ• โœ“
Wire Protocol Direct โœ• โœ• โœ• โœ“
Multi-Database โœ• โœ“ โœ“ โœ“
Type-Safe End-to-End โœ• โœ“ โœ• โœ“