{"id":23240996,"url":"https://github.com/rayzhuca/eggshell-db","last_synced_at":"2025-04-05T22:32:47.470Z","repository":{"id":223210293,"uuid":"741272332","full_name":"rayzhuca/eggshell-db","owner":"rayzhuca","description":"Relational database model built in C++","archived":false,"fork":false,"pushed_at":"2024-02-19T01:04:39.000Z","size":70,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T04:38:38.524Z","etag":null,"topics":["cpp","dbms"],"latest_commit_sha":null,"homepage":"","language":"C++","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/rayzhuca.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}},"created_at":"2024-01-10T03:44:10.000Z","updated_at":"2024-02-19T04:42:55.000Z","dependencies_parsed_at":"2024-02-19T02:24:00.524Z","dependency_job_id":"09716bf7-ba2f-460e-909b-4d6068b8a3cf","html_url":"https://github.com/rayzhuca/eggshell-db","commit_stats":null,"previous_names":["raybipse/eggshell-db","rayzhuca/eggshell-db"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayzhuca%2Feggshell-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayzhuca%2Feggshell-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayzhuca%2Feggshell-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayzhuca%2Feggshell-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rayzhuca","download_url":"https://codeload.github.com/rayzhuca/eggshell-db/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411234,"owners_count":20934650,"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":["cpp","dbms"],"created_at":"2024-12-19T05:14:54.758Z","updated_at":"2025-04-05T22:32:47.450Z","avatar_url":"https://github.com/rayzhuca.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg width=\"40\" valign=\"top\" alt=\"Screenshot 2024-02-18 at 4 57 57 PM\" src=\"https://github.com/RayBipse/eggshell-db/assets/46636772/d95263e6-8ef0-439d-8fd8-2028306f2421\"\u003e eggshell db\n\n![workflow badge](https://github.com/RayBipse/eggshell-db/actions/workflows/build.yml/badge.svg)\n\nRelational database model built in C++, written as a learning project.\n\nEggshell could support concurrent read and write operations. It utilizes a readers-writer lock.\n\nIt could also support atomicity, as previous pages are logged before they are modified.\n\nThe project includes two basic SQL commands,\n\n```SQL\nINSERT INTO table_name VALUES (value1, value2, ...);\n```\n\n```SQL\nSELECT column1, column2 FROM table_name;\n```\n\n\n## Architecture\n\nThe library is broken down into two sections, ``compiler`` and ``storage``, where the ``compiler`` composes inputs into\ncommands and ``storage`` is responsible for storing data.\n\n![toydb architecture (1)](https://github.com/RayBipse/eggshell-db/assets/46636772/1d4dd79e-6d65-4afa-a110-ab685f92ed6a)\n\n\n## Usage\n\nMust have C++-17 installed along with CMake.\n\nBefore the first build, run\n\n```zsh\ncmake -S . -B ./build \n```\n\nTo build, run\n\n```zsh\ncmake --build build\n```\n\nTo run the REPL, first create an empty file, e.g., ``touch example.db``, then run\n\n```zsh\nbuild/repl example.db\n```\n\n\n## Future features\n\nSome features to be implemented in the future are\n- ``JOIN`` clauses\n- Immutable B+ tree for complete atomic transactions\n- Distributed database\n- Error system (for now, we are just using ``exit`` on failure)\n\n\n## Tests\n\neggshell uses [Google Test](https://github.com/google/googletest), which is simple to configure and run.\nTo test, run the following command after building:\n\n```zsh\nctest --test-dir build\n```\n\nor alternatively,\n\n```zsh\nbuild \u0026\u0026 ctest\n```\n\nTo run a specific test, do\n\n```zsh\nbuild/{TEST_FILE_NAME}\n```\n\nIf intellisense is having trouble finding gtest, make sure to add the gtest onto the include path.\nFor VSCode, ``c_cpp_properties.json`` should have something like the following\n\n```json\n{\n\"configurations\": [\n        {\n            \"includePath\": [\n                \"${workspaceFolder}/_deps/googletest-src/googletest/include\"\n            ],\n        }\n    ]\n}\n```\n\n\n## Resources and credits\n\nAs someone who had no previous knowledge of databases, I have used numerous resources for this project that I would love to share.\n\n##### Good project examples\n\n[Let's Build a Simple Database (C)](https://cstack.github.io/db_tutorial/)\n\n[Build Your Own Database From Scratch (Go)](https://cstack.github.io/db_tutorial/)\n\n[toyDB (Rust)](https://github.com/erikgrinaker/toydb/blob/master/README.md)\n\n##### General database theory\n\n[CMU Database Group](https://youtu.be/DJ5u5HrbcMk?si=tMYnMY950OVwwrhH)\n\n##### Parser \n\n[Cornell Introduction to Compiler](https://www.cs.cornell.edu/courses/cs4120/2023sp/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frayzhuca%2Feggshell-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frayzhuca%2Feggshell-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frayzhuca%2Feggshell-db/lists"}