vibesql-ast

Crates.iovibesql-ast
lib.rsvibesql-ast
version0.1.4
created_at2025-12-04 00:01:25.582531+00
updated_at2026-01-19 06:25:00.094988+00
descriptionAbstract Syntax Tree definitions for vibesql SQL parser
homepage
repositoryhttps://github.com/rjwalters/vibesql
max_upload_size
id1965518
size416,133
Robb Walters (rjwalters)

documentation

README

vibesql-ast

Abstract Syntax Tree (AST) definitions for SQL:1999.

Overview

This crate defines the structure of SQL statements and expressions as parsed from SQL text. The AST provides a tree representation that preserves the semantic structure of SQL queries.

Features

  • DDL Statements: CREATE, ALTER, DROP for tables, views, indexes, sequences, etc.
  • DML Statements: INSERT, UPDATE, DELETE with full expression support
  • Query Expressions: SELECT with joins, subqueries, CTEs, window functions
  • Expression Trees: Binary/unary operators, functions, CASE expressions
  • Access Control: GRANT and REVOKE statements
  • Transaction Control: BEGIN, COMMIT, ROLLBACK, SAVEPOINT
  • Introspection: SHOW and DESCRIBE statements

Usage

Add this to your Cargo.toml:

[dependencies]
vibesql-ast = "0.1"

Basic example:

use vibesql_ast::{SelectStmt, Expression};

// AST nodes represent SQL structures
let expr = Expression::BinaryOp {
    left: Box::new(Expression::Identifier("age".to_string())),
    op: BinaryOperator::GreaterThan,
    right: Box::new(Expression::Literal(SqlValue::Integer(18))),
};

Documentation

License

This project is licensed under either of:

at your option.

Commit count: 3672

cargo fmt