┌─────────────────────────────────────────────────────────────┐ │ QAIL Layered Architecture │ ├─────────────────────────────────────────────────────────────┤ │ │ │ Layer 1: Intent (qail-core) │ │ QailCmd AST, Parser, Validator, Builder API │ │ │ │ Layer 2: Brain (protocol encoders) │ │ AST → Wire Protocol Bytes (pure, sync, no I/O) │ │ │ │ Layer 3: Muscle (drivers) │ │ Async I/O, Connection Pooling (tokio) │ │ │ │ Layer 4: Reality (databases) │ │ PostgreSQL, SQLite, MongoDB, DynamoDB │ │ │ └─────────────────────────────────────────────────────────────┘
Complete
In Progress
Planned
Layer 1: Intent (qail-core)
The universal AST that represents all database operations
| Component | Status | Description |
|---|---|---|
| QailCmd AST | 100% | Core data structure for all query types |
| Builder API | 100% | .get() .filter() .order_by() .limit() |
| Parser | 100% | Text syntax → AST (for CLI, LSP, WASM) |
| Validator | 100% | Schema validation with fuzzy suggestions |
| Formatter | 100% | AST → canonical text (qail fmt) |
Layer 2: Brain (Protocol Encoders)
Pure, synchronous conversion: AST → Wire Protocol Bytes
| Database | Simple Query | Extended Query | Parameter Binding |
|---|---|---|---|
| 100% | 100% | 100% | |
| v1.0 | v1.0 | v1.0 |
Layer 3: Muscle (Async Drivers)
Network I/O, connection pooling, response decoding
| Driver | Language | Status | Connection | Pooling |
|---|---|---|---|---|
| Rust | 80% | ✓ | ✓ | |
| Python | Beta | ✓ | 🚧 | |
| ⚡ qail-ffi | C / C++ | Alpha | ✓ | 🚧 |
Layer 4: Interface
💻
qail_CLI
StableLegacy: SQL Transpiler
AST → SQL String (for compatibility, WASM playground)
PostgreSQL
✓ SQLite
✓ MongoDB
✓ DynamoDB
✓ Qdrant
✓ Note: Only databases with open protocols are fully supported