Building a Simple SQL Query Evaluator

2025-02-19
Building a Simple SQL Query Evaluator

This post details building a simple SQL query evaluator capable of handling basic SELECT statements. The author starts by creating a simple test database, then improves upon previous work on SQLite file format parsing and SQL parsing to handle more complex queries. The core is the implementation of `Operator` and `Planner`; `Operator` executes database operations, and `Planner` translates parsed SQL into `Operator`. Currently, it lacks support for filtering, sorting, grouping, and joins, but lays the foundation for adding these features. Improvements to the `Pager` for concurrent access are also described.

Read more
Development Query Evaluator

Rust SQLite Parser: Adding CREATE TABLE Support

2025-02-04
Rust SQLite Parser: Adding CREATE TABLE Support

This post details extending a Rust-based SQLite parser to handle CREATE TABLE statements. By parsing the database schema table, the program extracts table names, root page numbers, and column names and types. The article explains lexical analysis, parsing, and abstract syntax tree (AST) construction, showing how extracted metadata is stored in the database structure, resulting in a more complete SQLite parser.

Read more
Development