Coverage Summary
| Area | Coverage | AST Capabilities & Notes |
|---|---|---|
| Expressions | Supported | Core query nodes, JSON querying, arrays, subscripts, and custom collations |
| DML Actions | Supported | Full read/write operations mapping straight to binary wire protocol formats |
| DDL Actions | Supported | Schema control, index setups, view generators, and database lifecycle management |
Expression Types
| Expression Node | QAIL AST Builder API | Transpiled SQL Example | Compatibility |
|---|---|---|---|
Expr::Named | Expr::Named("email".into()) | email | Supported |
Expr::Aliased | Expr::Aliased(name, alias) | users.email AS user_email | Supported |
Expr::Aggregate | Expr::Aggregate(func, col, filter) | COUNT(*) FILTER (WHERE ...) AS cnt | Supported |
Expr::Window | Expr::Window(func, partition, order, frame) | SUM(amount) OVER (PARTITION BY dept ORDER BY date) | Supported |
Expr::Case | Expr::Case(when_clauses, else_value) | CASE WHEN ... THEN 'A' ELSE 'B' END | Supported |
Expr::ArrayConstructor | Expr::ArrayConstructor(elements, alias) | ARRAY[col1, col2] AS arr | New Node |
Expr::RowConstructor | Expr::RowConstructor(elements, alias) | ROW(id, name) AS person | New Node |
Expr::Subscript | Expr::Subscript(expr, index, alias) | tags[1] AS first_tag | New Node |
Expr::Collate | Expr::Collate(expr, collation) | name COLLATE "C" | New Node |
Expr::FieldAccess | Expr::FieldAccess(expr, field, alias) | (address).city AS city | New Node |
Expr::Cast | Expr::Cast(expr, target_type) | id::TEXT | Supported |
Expr::JsonAccess | Expr::JsonAccess(column, path_segments) | data->'user'->>'name' AS name | Supported |
GROUP BY Modes
| Mode Struct | Transpiled SQL Output | Compatibility |
|---|---|---|
GroupByMode::Simple | GROUP BY a, b | Supported |
GroupByMode::Rollup | GROUP BY ROLLUP(a, b) | Supported |
GroupByMode::Cube | GROUP BY CUBE(a, b) | Supported |
GroupByMode::GroupingSets | GROUP BY GROUPING SETS ((a, b), (c)) | Supported |
DDL Actions
| Action Node | Transpiled SQL Output | Compatibility |
|---|---|---|
Action::Make | CREATE TABLE ... | Supported |
Action::Drop | DROP TABLE ... | Supported |
Action::Index | CREATE INDEX ... | Supported |
Action::CreateView | CREATE VIEW ... AS SELECT | Supported |
Action::DropView | DROP VIEW IF EXISTS ... | Supported |