{"id":22248296,"url":"https://github.com/p4zd4n/dbee","last_synced_at":"2026-05-09T16:02:40.311Z","repository":{"id":264931380,"uuid":"893871503","full_name":"P4ZD4N/dbee","owner":"P4ZD4N","description":"Authorial Relational Database Management System (RDBMS) created with C++20. DBee supports majority of SQL operations","archived":false,"fork":false,"pushed_at":"2025-01-18T15:49:36.000Z","size":220,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T10:43:08.567Z","etag":null,"topics":["cmake","cpp","cpp20","database","dbms","dbms-project"],"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/P4ZD4N.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}},"created_at":"2024-11-25T11:02:39.000Z","updated_at":"2025-01-18T15:49:38.000Z","dependencies_parsed_at":"2024-12-12T23:25:11.231Z","dependency_job_id":"ab8c9b7b-a193-481d-8b23-2ccac3ab4591","html_url":"https://github.com/P4ZD4N/dbee","commit_stats":null,"previous_names":["p4zd4n/dbee"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/P4ZD4N%2Fdbee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/P4ZD4N%2Fdbee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/P4ZD4N%2Fdbee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/P4ZD4N%2Fdbee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/P4ZD4N","download_url":"https://codeload.github.com/P4ZD4N/dbee/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245458122,"owners_count":20618693,"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":["cmake","cpp","cpp20","database","dbms","dbms-project"],"created_at":"2024-12-03T06:14:57.364Z","updated_at":"2026-05-09T16:02:35.291Z","avatar_url":"https://github.com/P4ZD4N.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 💻 DBee\n\n![](./images/logo.png)\n\n## 👀 About\n\nSimple **Relational Database Management System (RDBMS)** created with C++20. App is intended to serve as a storage, which enable to manage data with query language similar to SQL. User can create and manage multiple databases within the entire system. \n\nEach database is represented by the `Database` class, which stores essential information such as the database name (`std::string`) and a collection of tables (`std::unordered_map`). Each table is modeled using the `Table` class, which contains:\n\n-  Table name (`std::string`)\n-  Column names (`std::vector\u003cstd::string\u003e`)\n-  Column types (`std::vector\u003cColumnType\u003e`)\n-  Column-level constraints (`std::vector\u003cstd::vector\u003cConstraint\u003e\u003e`\n-   Foreign key definitions (`std::vector\u003cstd::pair\u003cTable*, std::string\u003e\u003e`)  - Each foreign key pair links a local column (by position) to a specific column in another table, ensuring referential integrity.\n-   Stored data (`std::vector\u003cstd::string\u003e`)\n\nSupported data types include `INTEGER`, `FLOAT`, and `TEXT`, all defined in the `ColumnType` enum. The system enforces type safety, preventing invalid inserts (e.g., adding text to an integer column). Constraints such as `PRIMARY KEY`, `FOREIGN KEY`, `UNIQUE`, and `NOT NULL` are also supported and represented via the `Constraint` enum.\n\nWhile building this system, I learned how relational databases work under the hood - including how they handle schemas, data types, constraints, and foreign keys. This helped me better understand how higher-level tools work and how to connect application development with how databases are actually built.\n\n## 🔧 Tech Stack\n\n- C++20\n- CMake\n\n## 💡 Features\n- Possibility to manage multiple independent databases in one environment.\n- Support for creating and managing tables with the ability to define columns with precisely defined data types: `INTEGER`, `FLOAT`, and `TEXT`.\n- Possibility to add important constraints on columns to ensure data integrity: `PRIMARY KEY`, `FOREIGN KEY`, `UNIQUE`, and `NOT NULL`.\n- Parser, which has ability to interpret queries written in a **SQL-like syntax** and execute proper operations based on entered query.\n- Possibility to save and read RDBMS data from file. Enable to restore the entire RDBMS structure including databases, tables, columns, constraints and data.\n\n## 🔍 Query language\n\nImplemented query language is similar to SQL but includes some key differences:\n- **No semicolon required** – Queries do **not** need to end with a semicolon.\n-   **Case-sensitive syntax** – All clauses must be written in **uppercase**. Lowercase or mixed-case keywords will not be recognized. Example:\n✅ DATABASE CREATE db\n❌ Database Create db\n\n### DDL\n\n- **`DATABASE CREATE \u003cdatabase_name\u003e`**  \n  Creates an empty database with no tables.  \n  \n  **Example:**  \n  ```DATABASE CREATE shop```\n  \n- **`DATABASE USE \u003cdatabase_name\u003e`**  \n  Selects the database to work with.\n  \n  **Example:**  \n  ``DATABASE USE shop``\n\n- **`DATABASE DROP \u003cdatabase_name\u003e`**  \n  Deletes the specified database.\n  \n  **Example:**  \n  ``DATABASE DROP shop``\n\n- **`TABLE CREATE \u003ctable_name\u003e WITH COLUMNS \u003ccolumn_name\u003e(\u003ctype\u003e)[\u003cconstraints\u003e]{\u003cforeign_reference\u003e}`**  \n  Creates a new table with specified columns, types, constraints, and optional foreign key references. Constraints are written **without spaces**, separated by commas inside square brackets. The foreign key reference (inside `{}`) is **optional** and only required when the column should reference another table.\n  \n  **Example:**  \n  ``TABLE CREATE watches WITH COLUMNS id(INTEGER)[PRIMARY_KEY], model(TEXT)[NOT_NULL], own_id(INTEGER)[FOREIGN_KEY]{users.id}``\n\n- **`TABLE DROP \u003ctable_name\u003e`**  \n  Removes a table from the current database.\n  \n  **Example:**  \n  ``TABLE DROP watches``\n\n- **`ALTER TABLE \u003ctable_name\u003e ADD COLUMN \u003ccolumn_name\u003e(\u003ctype\u003e)[\u003cconstraints\u003e]{\u003cforeign_reference\u003e}`**  \n  Adds a new column with optional constraints and an optional foreign key reference.\n  \n  **Example:**  \n  ``ALTER TABLE users ADD COLUMN id2(INTEGER)[PRIMARY_KEY]``\n\n- **`ALTER TABLE \u003ctable_name\u003e DROP COLUMN \u003ccolumn_name\u003e`**  \n  Removes a column from the table.\n  \n  **Example:**  \n  ``ALTER TABLE users DROP COLUMN id2``\n\n- **`ALTER TABLE \u003ctable_name\u003e ADD CONSTRAINT FOREIGN_KEY REFERENCES \u003ccolumn_name\u003e{\u003creferenced_table\u003e.\u003creferenced_column\u003e}`**  \n  Adds a foreign key constraint to a column, referencing another table.\n  \n  **Example:**  \n  ``ALTER TABLE pets ADD CONSTRAINT FOREIGN_KEY REFERENCES own_id{users.id}``\n\n- **`ALTER TABLE \u003ctable_name\u003e ADD CONSTRAINT \u003cCONSTRAINT_TYPE\u003e ON \u003ccolumn_name\u003e`**  \n  Adds a general constraint (`PRIMARY_KEY`, `UNIQUE`, or `NOT_NULL`) to a column.\n  \n  **Example:**  \n  ``ALTER TABLE users ADD CONSTRAINT UNIQUE ON pesel``\n\n### DML\n\n- **`INSERT INTO \u003ctable_name\u003e VALUES ...`**  \n  Inserts a new row into the specified table. Commas between values are optional. Multi-word strings can be wrapped in single quotes (`'...'`).\n\n  **Examples:**\n  ``INSERT INTO users VALUES 1 'Wiktor Chudy'``\n  ``INSERT INTO users VALUES 1, Wiktor``\n  ``INSERT INTO users VALUES 1 Wiktor``\n\n\n- **`UPDATE \u003ctable_name\u003e SET \u003ccolumn\u003e = \u003cvalue\u003e, ... WHERE \u003ccondition\u003e`**  \n  Updates records in a table based on optional filtering conditions. You can update **multiple columns** by separating them with commas after `SET`. The `WHERE` clause is **optional**. If omitted, all rows in the table will be updated. Logical operators supported: `\u0026\u0026` / `AND`, `||` / `OR`. Logical expressions are **evaluated left to right**, with **no precedence**, meaning parentheses are **not** supported.\n\n  **Example:**\n  ``UPDATE users SET name = Wiktor, weight = 75 WHERE name = wiktor \u0026\u0026 weight \u003e 100``\n  \n- **`DELETE FROM \u003ctable_name\u003e WHERE \u003ccondition\u003e`**  \n  Deletes rows from the specified table. The `WHERE` clause is **optional**. If omitted, **all data** in the table will be deleted. Logical operators and evaluation rules are the same as for `UPDATE`.\n\n  **Example:**\n  ``DELETE FROM users WHERE id = 1``\n\n### DQL\n\n- **`SELECT \u003ccolumn1\u003e, \u003ccolumn2\u003e, ... FROM \u003ctable1\u003e, \u003ctable2\u003e, ... WHERE \u003ccondition\u003e`**  \n  Retrieves values from specified columns and tables.  The `WHERE` clause is **optional**.\n  \n  **Examples:**\n  ``SELECT name, age FROM users``\n  ``SELECT name, age FROM users, pets``\n  ``SELECT name FROM users WHERE age \u003e 25``\n  \n- **`SELECT \u003ccolumns\u003e FROM \u003ctable1\u003e INNER JOIN \u003ctable2\u003e ON \u003ctable1.column\u003e = \u003ctable2.column\u003e WHERE ...`**  \n  Returns rows with **matching values** in both tables based on the specified join condition.  `WHERE` clause is **optional**.\n  \n  **Example:**\n  ``SELECT users.name, pets.name FROM users INNER JOIN pets ON users.id = pets.owner_id``\n\n- **`SELECT \u003ccolumns\u003e FROM \u003ctable1\u003e LEFT JOIN \u003ctable2\u003e ON \u003ctable1.column\u003e = \u003ctable2.column\u003e WHERE ...`**  \n  Returns all rows from the **left table**, and the matched rows from the right table.  \nRows from the left table with no match will still appear with empty values.  \n`WHERE` clause is optional.\n  \n  **Example:**\n  ``SELECT users.name, pets.name FROM users LEFT JOIN pets ON users.id = pets.owner_id``\n\n- **`SELECT \u003ccolumns\u003e FROM \u003ctable1\u003e RIGHT JOIN \u003ctable2\u003e ON \u003ctable1.column\u003e = \u003ctable2.column\u003e WHERE ...`**  \n  Returns all rows from the **right table**, and the matched rows from the left table.  \n`WHERE` clause is optional.\n  \n  **Example:**\n  ``SELECT users.name, pets.name FROM users RIGHT JOIN pets ON users.id = pets.owner_id``\n\n- **`SELECT \u003ccolumns\u003e FROM \u003ctable1\u003e FULL JOIN \u003ctable2\u003e ON \u003ctable1.column\u003e = \u003ctable2.column\u003e WHERE ...`**  \n  Returns all rows from both tables. If no match is found, `null` or empty values are returned for the missing side.  `WHERE` clause is optional.\n  \n  **Example:**\n  ``SELECT users.name, pets.name FROM users FULL JOIN pets ON users.id = pets.owner_id``\n\n### Other\n\n- **`SAVE`**  \n  Saves the current state of all databases to a file.\n\n- **`EXIT`**  \n  Exits the application.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp4zd4n%2Fdbee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp4zd4n%2Fdbee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp4zd4n%2Fdbee/lists"}