{"id":32473895,"url":"https://github.com/kimtth/mini-sqlite-engine-py-go-rust","last_synced_at":"2026-05-05T13:31:01.868Z","repository":{"id":320033719,"uuid":"1078153120","full_name":"kimtth/mini-sqlite-engine-py-go-rust","owner":"kimtth","description":"Learn Rust 🦀 \u0026 Golang 🔵 with a Mini-SQLite Database Engine 🏗️ (for Python users)","archived":false,"fork":false,"pushed_at":"2025-10-23T02:10:04.000Z","size":343,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-23T04:10:03.490Z","etag":null,"topics":["golang","mini-sql-engine","python","rust","sql-engine","sql-server"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kimtth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-17T09:36:16.000Z","updated_at":"2025-10-23T02:10:08.000Z","dependencies_parsed_at":"2025-10-23T04:10:07.652Z","dependency_job_id":null,"html_url":"https://github.com/kimtth/mini-sqlite-engine-py-go-rust","commit_stats":null,"previous_names":["kimtth/mini-sqlite-db-py-go-rust","kimtth/mini-sqlite-engine-py-go-rust"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/kimtth/mini-sqlite-engine-py-go-rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimtth%2Fmini-sqlite-engine-py-go-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimtth%2Fmini-sqlite-engine-py-go-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimtth%2Fmini-sqlite-engine-py-go-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimtth%2Fmini-sqlite-engine-py-go-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kimtth","download_url":"https://codeload.github.com/kimtth/mini-sqlite-engine-py-go-rust/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimtth%2Fmini-sqlite-engine-py-go-rust/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32651094,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","mini-sql-engine","python","rust","sql-engine","sql-server"],"created_at":"2025-10-26T19:21:17.171Z","updated_at":"2026-05-05T13:31:01.863Z","avatar_url":"https://github.com/kimtth.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mini sqlite \n\n## Polyglot SQL Engine 🧭\n\nAn educational project demonstrating a tiny SQL database engine implemented in three languages (Python, Go, Rust). Each implementation is a learning scaffold that covers parsing, query execution, a simple storage layer, a CLI shell and a minimal web UI. 🎓 (`Code generated by LLM`)\n\n## Directories in the workspace 📁\n\n- `mini_sqlite_python/` — Python edition (concise, easiest to run and modify) 🐍  \n  - README: mini_sqlite_python/README.md  \n  - Quick run:\n    - CLI: python main.py ▶️\n    - Web: python main.py --web 🌐\n  - Data files: mini_sqlite_python/data/*.dat (auto-created per database)\n\n- `mini_sqlite_golang/` — Golang edition (balanced simplicity and performance) 🐹  \n  - README: mini_sqlite_golang/README.md  \n  - Quick run:\n    - CLI: go run main.go ▶️\n    - Web: go run main.go -web 🌐\n  - Data files: mini_sqlite_golang/data/*.dat (auto-created per database)\n\n- `mini_sqlite_rust/` — Rust edition (type-safe, high performance) 🦀  \n  - README: mini_sqlite_rust/README.md  \n  - Quick run:\n    - Build: cargo build --release 🛠️\n    - CLI: cargo run --release ▶️\n    - Web: cargo run --release -- --web 🌐\n  - Data files: mini_sqlite_rust/data/*.dat (auto-created per database)\n\n## SQL shell \u0026 Web UI\n\n### 1. Web UI (Web Browser)\n\n![web_ui](./docs/web_ui.png)\n\n### 2. SQL shell (CLI)\n\n```cmd\nWelcome to the mini SQL shell. Type 'exit' to quit.\ndb\u003e CREATE DATABASE demo;\nDatabase 'demo' ready.\ndb\u003e USE demo;\nUsing database 'demo'.\ndb\u003e CREATE TABLE users (id INT, name TEXT, email TEXT);\nTable 'users' created.\ndb\u003e INSERT INTO users VALUES (1, 'Alice', 'alice@example.com');\n1 row inserted.\ndb\u003e INSERT INTO users VALUES (2, 'Bob', 'bob@example.com');\n1 row inserted.\ndb\u003e SELECT * FROM users;\nid | name | email\n1 | Alice | alice@example.com\n2 | Bob | bob@example.com\ndb\u003e SELECT name, email FROM users WHERE id = 2;\nname | email\nBob | bob@example.com\ndb\u003e UPDATE users SET email = 'alice.smith@example.com' WHERE id = 1;\n1 row(s) updated.\ndb\u003e ALTER TABLE users ADD COLUMN age INT;\nColumn 'age' added to 'users'.\ndb\u003e UPDATE users SET age = 30 WHERE id = 1;\n1 row(s) updated.\ndb\u003e SELECT * FROM users;\nid | name | email | age\n1 | Alice | alice.smith@example.com | 30\n2 | Bob | bob@example.com | None\ndb\u003e\n```\n\n## Purpose \u0026 Scope 🎯\n\nThis project is intentionally small and educational:\n- Demonstrates parser → executor → storage pipeline ⚙️\n- Uses file-backed B-Tree pages persisted as compact `.dat` files 🗄️\n- Provides a REPL (`db\u003e`) and a tiny web UI for querying 💻\n- Focuses on clarity over completeness or production-readiness ✅\n- The BTreeStroage in the code is not an actual B-Tree. For simplicity, replace it with an in-memory dictionary.\n\n## Where to start 🚀\n\n1. Choose an implementation folder (python/go/rust). 📂  \n2. Read that folder's README for implementation-specific instructions. 📖  \n3. Try the example queries in examples/sample.sql inside each subproject (where present). 🧪\n4. The root contains AGENT.MD (project goals and scaffolding plan) — see AGENT.MD. 📋  \n5. Use the language-specific READMEs for in-depth commands, structure and next steps. 🔧\n\n## Not implemented / Missing features ❗\n\nThe implementations in this workspace are intentionally minimal and educational. The following common relational-database features are not implemented yet and are good targets for future work:\n\n\u003cdetails\u003e\n\u003csummary\u003eExpand\u003c/summary\u003e\n\n- Query Capabilities\n  - [ ] Extended WHERE clause support (AND, OR, complex expressions)\n  - [ ] Aggregation functions (COUNT, SUM, AVG, MIN, MAX)\n  - [ ] ORDER BY and GROUP BY clauses\n  - [ ] Subqueries and correlated subqueries\n  - [ ] Window functions (ROW_NUMBER, RANK, etc.)\n  - [ ] Prepared statements and query parameterization\n\n- Storage \u0026 Persistence\n  - [ ] Write-ahead logging (WAL) for durability and crash-recovery\n  - [ ] Background compaction and segment merging\n  - [ ] Page-level caching and eviction policies\n  - [ ] Checkpointing and snapshotting\n\n- Transactions \u0026 Concurrency\n  - [ ] Serializable / snapshot isolation levels\n  - [ ] Lock manager or MVCC for concurrent access\n  - [ ] Transaction rollback and rollback segments\n  - [ ] Two-phase commit for distributed transactions\n\n- Indexing \u0026 Query Optimization\n  - [ ] B+tree persistent indexes for faster range scans\n  - [ ] Hash indexes for equality lookups\n  - [ ] Cost-based query planner and basic optimizations\n  - [ ] Statistics collection for planning\n\n- Error Handling \u0026 Validation\n  - [ ] Comprehensive error messages and error codes\n  - [ ] Input validation and SQL syntax diagnostics\n  - [ ] Transaction rollback support on error\n  - [ ] Strict type checking and casting rules\n\n\u003c/details\u003e\n\n## Further reading\n\n- [SQLite Architecture (official)](https://sqlite.org/arch.html) — deep dive into SQLite's architecture and internal design.\n- [AOSABook: The \"DBDB (Dog Bed Database)\" chapter](https://aosabook.org/en/500L/dbdb-dog-bed-database.html) — practical walkthrough of building a simple database and core concepts.\n- [cstack/db_tutorial](https://github.com/cstack/db_tutorial) — \"Let's Build a Simple Database\" tutorial (C) with clear explanations of storage and paging.\n- [codecrafters-io/build-your-own-sqlite](https://github.com/codecrafters-io/build-your-own-sqlite) — guided project to reimplement SQLite-like features as an educational exercise.\n- [msiemens/tinydb](https://github.com/msiemens/tinydb) — a lightweight, file-backed document DB in Python; useful reference for simple storage and API design.\n\n## Contributing \u0026 Licensing 🤝\n\n- Educational / MIT\n\n## Acknowledgments 🙏\n\nBuilt as a learning resource to understand database internals and storage engine design. 📚\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimtth%2Fmini-sqlite-engine-py-go-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkimtth%2Fmini-sqlite-engine-py-go-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimtth%2Fmini-sqlite-engine-py-go-rust/lists"}