{"id":13559615,"url":"https://github.com/joaoh82/rust_sqlite","last_synced_at":"2025-04-12T15:39:20.044Z","repository":{"id":39569100,"uuid":"330041868","full_name":"joaoh82/rust_sqlite","owner":"joaoh82","description":"SQLRite - Simple embedded database modeled off SQLite in Rust","archived":false,"fork":false,"pushed_at":"2022-07-12T08:16:27.000Z","size":397,"stargazers_count":1084,"open_issues_count":3,"forks_count":58,"subscribers_count":44,"default_branch":"main","last_synced_at":"2025-04-03T16:11:41.230Z","etag":null,"topics":["computer-science","database-design","databases","rust-lang","sqlite-architecture"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joaoh82.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-15T23:08:17.000Z","updated_at":"2025-04-01T22:55:22.000Z","dependencies_parsed_at":"2022-07-18T03:00:35.900Z","dependency_job_id":null,"html_url":"https://github.com/joaoh82/rust_sqlite","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaoh82%2Frust_sqlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaoh82%2Frust_sqlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaoh82%2Frust_sqlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaoh82%2Frust_sqlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joaoh82","download_url":"https://codeload.github.com/joaoh82/rust_sqlite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248590661,"owners_count":21129870,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["computer-science","database-design","databases","rust-lang","sqlite-architecture"],"created_at":"2024-08-01T13:00:29.952Z","updated_at":"2025-04-12T15:39:20.014Z","avatar_url":"https://github.com/joaoh82.png","language":"Rust","readme":"Rust-SQLite (SQLRite)\n===\n[![Build Status](https://github.com/joaoh82/rust_sqlite/workflows/Rust/badge.svg)](https://github.com/joaoh82/rust_sqlite/actions)\n[![dependency status](https://deps.rs/repo/github/joaoh82/rust_sqlite/status.svg)](https://deps.rs/repo/github/joaoh82/rust_sqlite)\n[![Coverage Status](https://coveralls.io/repos/github/joaoh82/rust_sqlite/badge.svg?branch=main)](https://coveralls.io/github/joaoh82/rust_sqlite?branch=main)\n[![Maintenance](https://img.shields.io/badge/maintenance-actively%20maintained-brightgreen.svg)](https://deps.rs/repo/github/joaoh82/rust_sqlite)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n\n`Rust-SQLite`, aka `SQLRite` , is a simple embedded database modeled off `SQLite`, but developed with `Rust`. The goal is get a better understanding of database internals by building one.\n\n\u003e What I cannot create, I do not understand. \n\u003e — Richard Feynman\n\n\n\u003ctable style=\"width:100%\"\u003e\n\u003ctr\u003e\n  \u003ctd\u003e\n    \u003ctable style=\"width:100%\"\u003e\n      \u003ctr\u003e\n        \u003ctd\u003e key \u003c/td\u003e\n        \u003ctd\u003e value \u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n        \u003ctd\u003e\u003ca href=\"https://github.com/sqlrite/design\"\u003eDesign and discussions about direction\u003cbr\u003eof the project going on over here.\u003c/a\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n        \u003ctd\u003e\u003ca href=\"https://github.com/sponsors/joaoh82\"\u003eShow us your support by buying us a coffee, \u003cbr\u003eso we can keep building cool stuff. (coming soon)\u003c/a\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ca href=\"https://github.com/sponsors/joaoh82\"\u003e\u003cimg src=\"https://img.shields.io/opencollective/backers/sqlrite\"\u003e\u003c/a\u003e\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n        \u003ctd\u003e\u003ca href=\"https://docs.rs/sqlrite\"\u003eDocumentation (coming soon)\u003c/a\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ca href=\"https://docs.rs/sqlrite\"\u003e\u003cimg src=\"https://docs.rs/sqlrite/badge.svg\"\u003e\u003c/a\u003e\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n        \u003ctd\u003e\u003ca href=\"https://discord.gg/dHPmw89zAE\"\u003eCome and Chat about databases with us\u003c/a\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ca href=\"https://discord.gg/dHPmw89zAE\"\u003e\n        \u003cimg src=\"https://discordapp.com/api/guilds/853931853219758091/widget.png?style=shield\" alt=\"sqlritedb discord server\"/\u003e\u003c/a\u003e\u003c/td\u003e\n      \u003c/tr\u003e\n     \u003c/table\u003e\n  \u003c/td\u003e\n  \u003ctd\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/SQLRite_logo.png\" width=\"50%\" height=\"auto\" /\u003e \n  \u003c/p\u003e\n  \u003c/td\u003e\n \u003c/tr\u003e\n\u003c/table\u003e\n\n### Read the series of posts about it:\n##### What would SQLite look like if written in Rust?\n* [Part 0 - Overview](https://medium.com/the-polyglot-programmer/what-would-sqlite-would-look-like-if-written-in-rust-part-0-4fc192368984)\n* [Part 1 - Understanding SQLite and Setting up CLI Application and REPL](https://medium.com/the-polyglot-programmer/what-would-sqlite-look-like-if-written-in-rust-part-1-4a84196c217d)\n* [Part 2 - SQL Statement and Meta Commands Parser + Error Handling](https://medium.com/the-polyglot-programmer/what-would-sqlite-look-like-if-written-in-rust-part-2-55b30824de0c)\n* [Part 3 - Understanding the B-Tree and its role on database design](https://medium.com/the-polyglot-programmer/what-would-sqlite-look-like-if-written-in-rust-part-3-edd2eefda473)\n\n![The SQLite Architecture](images/architecture.png \"The SQLite Architecture\")\n\n### CREATE TABLE and INSERT Statements\n[![asciicast](https://asciinema.org/a/406447.svg)](https://asciinema.org/a/406447)\n\n### Requirements\nBefore you begin, ensure you have met the following requirements:\n* Rust (latest stable) – [How to install Rust](https://www.rust-lang.org/en-US/install.html)\n* SQLite3\n\n### Usage (TBD)\n\n```shell\n\u003e ./rust_sqlite -- help\nSQLRite 0.1.0\nJoao Henrique Machado Silva \u003cjoaoh82@gmail.com\u003e\nLight version of SQLite developed with Rust\n\nUSAGE:\n    rust_sqlite\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n```\n\n### Project Progress\n*Not checked means I am currently working on.*\n- [x] CLI and REPL Interface\n- [x] Parse meta commands and sql commands.\n- [x] Execute simple commands\n- [x] Standarized error handling\n- [x] Generic validation structure for SQL Commands.\n- [x] `Create Table` Command Parsing\n- [x] Improve error handling with https://github.com/dtolnay/thiserror\n- [x] Added support for parsing duplicate columns on CREATE TABLE\n- [x] Added support for parsing multiple PRIMARY KEY on CREATE TABLE\n- [x] In memory BTreeMap indexes initially only for PRIMARY KEYS.\n- [x] Simple INSERT queries command parsing.\n- [x] Implementation UNIQUE key constraints.\n- [ ] Improve Error Handling and return without Panic!\n- [ ] Simple SELECT queries (Single WHERE clause and no JOINS).\n- [ ] Serialization | Deserialization to and from binary encodings ([bincode](https://crates.io/crates/bincode)).\n\n\n### Roadmap\nFeatures that are in the roadmap of the project:\n\n*Ideally in order of priority, but nothing set in stone.*\n\n\n- [ ] Implement Open command to load database with a command `.open`\n- [ ] Joins\n  - [ ] INNER JOIN (or sometimes called simple join)\n  - [ ] LEFT OUTER JOIN (or sometimes called LEFT JOIN)\n  - [ ] CROSS JOIN\n  - The RIGHT OUTER JOIN and FULL OUTER JOIN are not supported in SQLite.\n- [ ] WAL - Write Ahead Log Implementation\n- [ ] `Pager Module` \n  - [ ] Implementing transactional ACID properties\n  - [ ] Concurrency\n  - [ ] Lock Manager\n- [ ] Composite Indexing - cost and performance gain analysis\n- [ ] Benchmarking vs SQLite for comparison\n- [ ] Server Client / Connection Manager\n- [ ] Different implementations of storage engines and data structures to optimize for different scenarios\n  - [ ] Write Heavy - `LSM Tree \u0026\u0026 SSTable`\n  - [ ] Read Heavy - `B-Tree`\n\n### Contributing\n**Pull requests are warmly welcome!!!**\n\nFor major changes, please [open an issue](https://github.com/joaoh82/rust_sqlite/issues/new) first and let's talk about it. We are all ears!\n\nIf you'd like to contribute, please fork the repository and make changes as you'd like and shoot a Pull Request our way!\n\n**Please make sure to update tests as appropriate.**\n\nIf you feel like you need it go check the GitHub documentation on [creating a pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request).\n\n### Code of Conduct\n\nContribution to the project is organized under the terms of the\nContributor Covenant, the maintainer of SQLRite, [@joaoh82](https://github.com/joaoh82), promises to\nintervene to uphold that code of conduct.\n\n### Contact\n\nIf you want to contact me you can reach me at \u003cjoaoh82@gmail.com\u003e.\n\n##### Inspiration\n* https://cstack.github.io/db_tutorial/\n","funding_links":["https://github.com/sponsors/joaoh82"],"categories":["Rust","Dev-Utilities"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoaoh82%2Frust_sqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoaoh82%2Frust_sqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoaoh82%2Frust_sqlite/lists"}