Expand description
QAIL SchemaOps CLI library surface.
The qail crate is primarily installed as a command-line tool:
cargo install qail
qail pull --url postgres://... > schema.qail
qail diff _ schema.qail --live --url postgres://...
qail migrate apply --phase expand
qail migrate apply --phase backfill
qail migrate apply --phase contract --codebase ./srcFor application runtime code, start with:
qail-corefor the AST Kernel: typed query AST, expressions, RLS, and native access policy.qail-pgfor the Postgres Driver: async wire-protocol execution of QAIL AST commands.qail-gatewayfor the Access Gateway: AutoREST, WebSocket, OpenAPI, and policy enforcement.
This library re-exports selected parser and AST modules for the CLI’s own internals and for advanced tooling. It is not the preferred runtime entry point for database access.
Modules§
- ast
- Abstract syntax tree types.
- backup
- Backup utilities for safe migrations.
- branch
- Branch management CLI commands — Data Virtualization
- colors
- Lightweight ANSI terminal colors — replaces the
coloredcrate. - error
- Error types. Error types for QAIL.
- exec
- Exec module - Execute QAIL AST for seeding/admin tasks
- init
- qail init - Project initialization
- introspection
- Database Schema Introspection
- lint
- Schema linting for best practices
- migrations
- Migration operations for QAIL CLI
- parser
- QAIL query parser. QAIL Parser using nom.
- prelude
- Common re-exports for convenient wildcard imports.
- resolve
- Centralized resolution for database URL and SSH tunnel config.
- schema
- Schema validation and diff operations
- schema_
tools - Modular schema tooling (
qail schema ...). - shadow
- Shadow Database (Blue-Green) Migrations
- sql_gen
- SQL generation utilities for migrations
- sync
- qail sync - Generate sync triggers from qail.toml
- time
- Lightweight timestamp formatting — replaces the
chronocrate. - transpiler
- SQL transpiler (AST to SQL). SQL Transpiler for QAIL AST.
- types
- Type-safe schema code generation CLI wrapper.
- util
- Utility functions for qail-cli
Functions§
- parse
- Parse a complete QAIL query string (v2 syntax only).
Uses keyword-based syntax:
get table fields * where col = valueAlso supports shorthand:get table[filter]desugars toget table where filter