🪝 QAIL — The Universal Query Transpiler
SQL is Assembly. Stop writing Assembly. Write Qail. Compile to Safety.
What is QAIL?
QAIL is not an ORM. It is not a Query Builder.
QAIL is a Query Transpiler.
Write high-density, logic-focused queries in QAIL, and it compiles them instantly into Safe, Optimized, Raw SQL with zero runtime overhead.
-- SQL (Assembly)
SELECT id, email FROM users WHERE active = true LIMIT 10;
# QAIL
One line. Zero ceremony. Runs everywhere.
🚀 Installation
Rust / CLI
Rust Library
[]
= "0.5.0"
JavaScript / Browser (WASM)
💡 Usage
Rust
use qail;
// Compile-time validated query
let sql = qail!;
// Returns: "SELECT id, email FROM users WHERE active = true"
JavaScript / TypeScript
import from 'qail-wasm';
const sql = ;
// Returns: "SELECT id, email FROM users WHERE active = true"
📖 Quick Reference
| Symbol | Name | Function | 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" |
~ |
The Fuse | Fuzzy match | 'name ~ "john" |
| |
The Split | Logical OR | 'a == 1 | 'b == 2 |
& |
The Bind | Logical AND | 'a == 1 & 'b == 2 |
+/- |
Sort Order | ASC/DESC | -created_at |
N..M |
The Range | Pagination | 0..10 |
$ |
The Var | Parameter | $1 |
! |
The Unique | Distinct | get!:: |
<- |
The Left | Left Join | users<-profiles |
-> |
The Right | Inner Join | users->orders |
📚 Examples
Basic SELECT
All Columns
Sorting
Pagination
Fuzzy Search
UPDATE
DELETE
DISTINCT
JOINs
# → SELECT name, avatar FROM users LEFT JOIN profiles ON ...
🌐 One Language. Everywhere.
QAIL works in:
- Rust —
qail-core+qail!macro (compile-time) - Node.js —
qail-wasm(runtime) - Browser —
qail-wasm(~50KB)
Same syntax. Same validation. Any stack.
🤝 Contributing
We welcome contributions!
📄 License
MIT © 2025 QAIL Contributors