What is QAIL?
QAIL is not an ORM. It is not a Query Builder.
QAIL is a Query Transpiler.
It is a lightweight language that sits between your application code and your database. You write high-density, logic-focused queries in QAIL, and it compiles them instantly into Safe, Optimized, Raw SQL with zero runtime overhead.
The Universal Approach
QAIL is designed to work everywhere.
- In Rust: The
qail!()macro compiles it to SQL at build time. - In Node/Browser: The
qail-wasmpackage compiles it to SQL at runtime. - Zero Dependencies: Pure parser + transpiler. You bring your own database driver.
One Language. Everywhere.
get::users:'id'email [ 'active == true, 0..10 ]
SELECT id, email FROM users WHERE active = true LIMIT 10
Simple, Symbolic Syntax
QAIL uses simple symbols to keep queries short and readable.
| Symbol | Name | Purpose | Example |
|---|---|---|---|
:: |
The Gate | Action (get, set, del, add) | get:: |
: |
The Link | Connect table to columns | users:'id |
' |
The Label | Mark a column | 'email'name |
'_ |
The Wildcard | All columns | users:'_ |
[ ] |
The Cage | Constraints block | [ 'active == true ] |
== |
The Equal | Equality check | 'status == "active" |
+/- |
Sort Order | ASC/DESC | -created_at |
N..M |
The Range | Pagination | 0..10 |
End-to-End Validation
Use QAIL in both your frontend and backend for consistent query validation.
Your frontend knows exactly what queries are valid — before sending them to the server.
[ ANY FRONTEND ] [ ANY BACKEND ]
(qail-wasm) (qail-core)
| |
+--- Construct Query ----------->|
| (Validate locally) |
| Re-Validate & Compile
| |
|<-- Return Data (JSON) ---------+
Works with React, Vue, Angular, Node.js, Go, Python, Rust — any stack.
The Promise
QAIL gives you the brevity of a CLI tool, the safety of Rust, and the control of writing raw SQL strings.