3 releases
Uses new Rust 2024
| 0.1.2 | Sep 21, 2025 |
|---|---|
| 0.1.1 | Sep 21, 2025 |
| 0.1.0 | Sep 21, 2025 |
#602 in Database interfaces
35KB
698 lines
RuneDB
In this fully functional mini database engine made from scratch in Rust, the user can write queries using python-like syntax to store data in a database, just like how real relational database systems like SQLite work internally. This project implements a custom query language, paging-based storage engine, and an interactive terminal-based interface for running queries — just like using SQL in a CLI.
Tech Stack
Why RuneDB?
This project aims to simplify database development with a focus on ease of use and extensibility. The core features include:▫️Modular Architecture: Clear separation of parsing, data structures, and execution layers for easy customization.
▫️Interactive CLI: Create databases, define tables, insert data, and perform queries with straightforward commands.
▫️Custom DSL: A domain-specific language for schema design, data insertion, and complex queries.
▫️Serialization & Parsing: Robust handling of data encoding, decoding, and input validation.
▫️Execution Engine: Manages in-memory databases, ensuring data integrity and efficient query execution.
📌 Key Features
▫️Custom query language with SQL-like syntax (pick, where, etc.)▫️Grammar and parsing implemented using pest
▫️Paging-based storage engine (4KB pages) for efficient data management
▫️Table-to-page mapping using a page directory
▫️Attribute schema with support for int, string, and bool data types
▫️Conditional query evaluation (==, !=, <, <=, >, >=)
▫️Tabular formatted output in the terminal
▫️Persistent storage using rmp-serde (MessagePack serialization)
Get started
Prerequisites
This project requires the following dependencies:▫️Programming Language: Rust
▫️Package Manager: Cargo
Installation
▫️Build RuneDB from the source and install dependencies:Clone the repository
git clone https://github.com/SriyaNan/RuneDB
Navigate to the project directorycd RuneDB
Using cargocargo build
Run the projectcargo run
Syntax
▫️Create a new Database: make rdb database-name▫️Create a table: make table table-name( attr-name : datatype, ... )
▫️Insert rows: table-name.add(value, ... )
▫️Select columns: table-name.pick( attr-name, ... )
▫️Select with condition: table-name.pick( (attr-name, ... ) where ( attr-name = value, ... ) )
Outcome
A standalone terminal-based database engine executable that allows users to create, query, and manage tables through a custom syntax.Dependencies
~2.5–3.5MB
~71K SLoC