Skip to content

Nisha-gpt/sql-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust SQL Parser By Nisha Murali 🦀📄

A Rust-based SQL parser that can tokenize and parse basic SQL statements like SELECT and CREATE TABLE. This project demonstrates foundational compiler design concepts like tokenization, expression parsing (via Pratt parsing), abstract syntax trees, and error handling — all in Rust.


📌 Features

✅ Tokenizer
✅ Pratt Expression Parser
✅ SELECT Parser (SELECT, WHERE, ORDER BY)
✅ CREATE TABLE Parser (with types & constraints)
✅ AST Output
✅ CLI-based interactive SQL input
✅ Full error handling with meaningful messages


🧠 Technologies Used

  • Rust
  • CLI (Command Line Interface)
  • Pratt Parsing (top-down operator precedence)
  • AST (Abstract Syntax Tree)

🔢 Supported SQL Examples

✅ SELECT

SELECT name, age FROM users WHERE age > 18 ORDER BY name;

CREATE TABLE students ( id INT PRIMARY KEY,name VARCHAR NOT NULL,age INT CHECK(age >= 18));

About

A Rust-based SQL parser that can tokenize and parse basic SQL statements like `SELECT` and `CREATE TABLE`. This work is a college project!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors