Rust implementation of basic SQL database, originally implemented in Java by the Edward Sciore's book "Database Design and implementation".
simpledb is a database engine that can handle a subset of SQL. The following is the examples of commands which can be accepted by simpledb.
-- Creating tables
CREATE TABLE users(id INT, name VARCHAR(16));
-- Insertions
INSERT INTO users(id, name) VALUES(1, 'User');
-- Queries
SELECT u.id, u.name FROM users u where u.id=1;
-- Removal
DELETE FROM users WHERE id=1;
-- Updating
UPDATE users SET name='Other' WHERE id=1;
-- Index creation
CREATE INDEX users_ids ON users(id);
-- View for joins
CREATE TABLE salaries(user_id INT, amount INT);
CREATE VIEW users_salaries AS select id, amount FROM users, salaries WHERE id=user_id;| Book Chapter | Feature | Implemented |
|---|---|---|
| 3 | File Manager | ✔️ |
| 4 | Log Manager | ✔️ |
| 4 | Buffer Manager | ✔️ |
| 5 | Recovery Manager | ✔️ |
| 5 | Concurrency Manager | ✔️ |
| 5 | Transaction | ✔️ |
| 6 | Record Pages | ✔️ |
| 6 | Table Scans | ✔️ |
| 7 | Metadata Manager | ✔️ |
| 8 | Select Scans, Project Scans, Product Scans | ✔️ |
| 9 | Parser | ✔️ |
| 10 | Planner | ✔️ |
| 11 | Embedded JDBC Interface | ✔️ |
| 11 | Remote JDBC Interface | ❌ |
| 12 | Static Hash Indexes | ❌ |
| 12 | Btree Indexes | ✔️ |
| 13 | Materialization and Sorting | ✔️ |
| 14 | MultiBuffer Sorting/Product | ✔️ |
| 15 | Query Optimization | ✔️ |
The Remote JDBC Interface and network interface is in development(DB_00003 branch)
B-Tree Index- implemented as single file structure, without using the recursion oninsert,getanddeleteJOINs- can be executed in two types of queriesSELECT a, b FROM a, bandSELECT a, b FROM a JOIN b ON a = b
Clone this repository
cargo build --releaseThen the executables will be generated in the target/release folder.
cd target/release
./cli