| Crates.io | quill-sql |
| lib.rs | quill-sql |
| version | 0.2.1 |
| created_at | 2025-09-28 16:45:00.538249+00 |
| updated_at | 2026-01-07 04:45:54.424194+00 |
| description | An educational Rust relational database (RDBMS) inspired by CMU 15445 |
| homepage | |
| repository | https://github.com/feichai0017/quillsql |
| max_upload_size | |
| id | 1858486 |
| size | 4,382,637 |
An educational Rust RDBMS for cmu15445-style teaching (BusTub-inspired)
BEGIN/COMMIT/ROLLBACK, SET TRANSACTION, SET SESSION TRANSACTION, enforced READ ONLY, row/table locksinformation_schema.schemas, tables, columns, indexesBuilt-in web TTY β commands mirror our SQL test suite.
cargo run --bin server and open http://127.0.0.1:8080help, docs, doc <name>, examples, example <name>, github, profilesrc/tests/sql_example/cargo run --bin client
# or open a persistent DB file
cargo run --bin client -- --file my.db
# start web server (http://127.0.0.1:8080)
cargo run --bin server
# specify data file and listening addr
QUILL_DB_FILE=my.db QUILL_HTTP_ADDR=0.0.0.0:8080 cargo run --bin server --release
# batch API (optional)
curl -XPOST http://127.0.0.1:8080/api/sql_batch -H 'content-type: application/json' \
-d '{"sql": "SHOW TABLES; EXPLAIN SELECT 1;"}'
Sample session:
CREATE TABLE t(id INT, v INT DEFAULT 0);
INSERT INTO t(id, v) VALUES (1, 10), (2, 20), (3, 30);
SELECT id, v FROM t WHERE v > 10 ORDER BY id DESC LIMIT 1;
SHOW DATABASES;
SHOW TABLES;
EXPLAIN SELECT id, COUNT(*) FROM t GROUP BY id ORDER BY id;
Data types
BOOLEAN, INT8/16/32/64, UINT8/16/32/64, FLOAT32/64, VARCHAR(n)CREATE TABLE
NOT NULL | DEFAULT <literal>CREATE TABLE t(
id INT64 NOT NULL,
v INT32 DEFAULT 0
);
CREATE INDEX
CREATE INDEX idx_t_id ON t(id);
DROP
DROP TABLE [IF EXISTS] <name>DROP INDEX [IF EXISTS] <name>DROP INDEX IF EXISTS idx_orders_user_id;
DROP TABLE orders;
INSERT
INSERT INTO ... VALUES (...) and INSERT INTO ... SELECT ...SELECT
Projection: columns, literals, aliases
FROM: table | subquery (FROM (SELECT ...)) β alias not yet supported
WHERE: comparison/logical operators = != > >= < <= AND OR
GROUP BY: aggregates COUNT(expr|*), AVG(expr)
ORDER BY: ASC|DESC, supports NULLS FIRST|LAST
LIMIT/OFFSET
JOIN: INNER JOIN (with ON condition), CROSS JOIN
UPDATE
UPDATE t SET col = expr [, ...] [WHERE predicate]DELETE
DELETE FROM t [WHERE predicate]SHOW
SHOW DATABASES; (rewritten to SELECT schema FROM information_schema.schemas)
SHOW TABLES; (rewritten to SELECT table_name FROM information_schema.tables)
EXPLAIN
EXPLAIN <statement> returns a single column named plan with multiple lines showing the logical plan treeALTER, predicate locking.ORDER BY DESC / NULLS FIRST|LAST currently affects sorting only (not storage layout)cargo test -q
Minimal environment variables (runtime only)
QUILL_HTTP_ADDR)0.0.0.0:8080)read-uncommitted, read-committed, repeatable-read, serializable)Programmatic options live in quillsql::config (see docs) β build DatabaseOptions with WalOptions, BufferPoolConfig, BTreeConfig, etc., and pass into Database::new_*_with_options. Examples in the docs remain unchanged.
# build
docker build -t quillsql:latest .
# run (ephemeral in-memory DB)
docker run --rm -p 8080:8080 quillsql:latest
# run with persistent file mounted
docker run --rm -p 8080:8080 -e QUILL_DB_FILE=/data/my.db -v $(pwd)/data:/data quillsql:latest
Includes sqllogictest-based cases:
src/tests/sql_example/create_table.sltsrc/tests/sql_example/create_index.sltsrc/tests/sql_example/insert.sltsrc/tests/sql_example/show_explain.sltsrc/tests/sql_example/delete.sltBuild. Break. Benchmark. Repeat.
QuillSQL has a Discord server for discussions, support, and experimental DB hacking.
What you can do here: