vibesql-executor
SQL query execution engine for VibeSQL database.
Overview
This crate provides the query execution engine that processes SQL statements against the storage layer. It includes query optimization, expression evaluation, and execution of DDL, DML, and query operations.
Features
- Query Execution: SELECT with joins, aggregates, window functions, CTEs
- DDL Operations: CREATE, ALTER, DROP for all database objects
- DML Operations: INSERT, UPDATE, DELETE with constraint validation
- Expression Evaluation: Full SQL expression support with type coercion
- Query Optimization: Join reordering, predicate pushdown, subquery optimization
- Query Plan Cache: LRU cache for compiled query plans
- Common Subexpression Elimination: Automatic CSE for repeated expressions
- Transaction Support: BEGIN, COMMIT, ROLLBACK, SAVEPOINT
- Constraint Validation: PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK
- Triggers: BEFORE/AFTER INSERT/UPDATE/DELETE triggers
- Access Control: GRANT/REVOKE privilege checking
- Advanced Objects: Functions, procedures, sequences, domains
Usage
Add this to your Cargo.toml:
[]
= "0.1"
Basic example:
use QueryExecutor;
use Database;
use Catalog;
// Create database and executor
let catalog = new;
let mut db = new;
let mut executor = new;
// Execute a query
let result = executor.execute?;
// Process results
for row in result.rows
Documentation
License
This project is licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.