{"id":27553676,"url":"https://github.com/darkmortal/kaizer-db","last_synced_at":"2025-04-19T12:52:55.241Z","repository":{"id":239161721,"uuid":"798738789","full_name":"DarkMortal/Kaizer-DB","owner":"DarkMortal","description":"A lightweight and minimal csv database package with SQL-like syntax","archived":false,"fork":false,"pushed_at":"2025-01-26T15:03:59.000Z","size":159,"stargazers_count":11,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T20:47:38.558Z","etag":null,"topics":["csv","database","nodejs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/kaizer-db","language":"JavaScript","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/DarkMortal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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-05-10T11:16:11.000Z","updated_at":"2025-03-19T11:06:38.000Z","dependencies_parsed_at":"2024-05-10T12:32:18.304Z","dependency_job_id":"3d64fd87-5aa8-4030-bfe5-a9c303770c01","html_url":"https://github.com/DarkMortal/Kaizer-DB","commit_stats":null,"previous_names":["darkmortal/kaizer-db"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkMortal%2FKaizer-DB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkMortal%2FKaizer-DB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkMortal%2FKaizer-DB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkMortal%2FKaizer-DB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DarkMortal","download_url":"https://codeload.github.com/DarkMortal/Kaizer-DB/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249699394,"owners_count":21312389,"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":["csv","database","nodejs"],"created_at":"2025-04-19T12:52:52.416Z","updated_at":"2025-04-19T12:52:55.232Z","avatar_url":"https://github.com/DarkMortal.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/darkmortal"],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003e📊 Welcome to Kaizer-DB 📊\u003c/h1\u003e\r\n\r\n![Logo](https://github.com/DarkMortal/Kaizer-DB/assets/67017303/cc9882fe-6980-4fcd-b211-bcdb5ea8d034)\u003cbr/\u003e\r\n![NPM Downloads](https://img.shields.io/npm/d18m/kaizer-db?style=for-the-badge\u0026label=Total%20Downloads)\r\n\u003ca href=\"https://www.buymeacoffee.com/darkmortal\" target=\"_blank\"\u003e\r\n  \u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" width=\"174px\" height=\"41px\"\u003e\r\n\u003c/a\u003e\r\n---\r\n\r\n\u003ch2\u003e🚀 Features 🚀\u003c/h2\u003e\r\n\r\n- SQL-like Syntax\u003c/strong\u003e: Easily write `SELECT`, `INSERT`, `UPDATE`, and `DELETE` queries.\r\n- CSV Integration\u003c/strong\u003e: Directly interact with CSV files as lightweight databases.\r\n- CRUD Support\u003c/strong\u003e: Perform essential Create, Read, Update, and Delete operations.\r\n- Minimal Overhead\u003c/strong\u003e: Ideal for prototyping and small-scale projects.\r\n---\r\n\r\n\u003ch2\u003e⚠️ Limitations ⚠️\u003c/h2\u003e\r\n\r\n- No type checking.\r\n- Supports only one query execution at a time.\r\n- Does not handle data with spaces.\r\n---\r\n\r\n\u003ch2\u003e🔧 Tech Stack 🔧\u003c/h2\u003e\r\n\r\n\u003cp\u003e\r\n  \u003cimg src=\"https://img.icons8.com/color/48/000000/javascript.png\" alt=\"JavaScript\" /\u003e\r\n  \u003cimg src=\"https://img.icons8.com/color/48/000000/nodejs.png\" alt=\"Node.js\" /\u003e\r\n  \u003cimg src=\"https://img.icons8.com/color/48/000000/npm.png\" alt=\"NPM\" /\u003e\r\n\u003c/p\u003e\r\n\r\n---\r\n\r\n\u003ch2\u003e🎓 Installation \u0026 Setup 🎓\u003c/h2\u003e\r\n\r\n### 1. Clone the Repository\r\n```bash\r\ngit clone https://github.com/DarkMortal/Kaizer-DB.git\r\ncd Kaizer-DB\r\n```\r\n\r\n### 2. Install dependencies\r\n```bash\r\nyarn install # or npm install\r\n```\r\n\r\n### 3. Start the CLI\r\n```bash\r\nyarn start # or npm start\r\n```\r\n\r\n### 4. Global Installation\r\nInstall the package globally using npm:\r\n\r\n```bash\r\nnpm install -g kaizer-db\r\n```\r\n\r\nRun the CLI from anywhere:\r\n\r\n```bash\r\nkaizer-db\r\n```\r\n\r\n---\r\n\r\n\u003ch2 style=\"color: #1E90FF;\"\u003e💡 How It Works 💡\u003c/h2\u003e\r\n\r\n### Example Queries\r\n\r\n#### **Creating and Using a Database**\r\n\r\n```\r\nUse Database mydb;\r\nCreate Database mydb;\r\n```\r\n\r\nCreates a folder named `mydb` where tables are stored as `.csv` files.\r\n\r\n#### **Creating a Table**\r\n\r\n```\r\nCreate Table Warriors (Name, Attack, Defense, PowerLevel);\r\n```\r\n\r\nCreates a file named `Warriors.csv` with the given headers.\r\n\r\n#### **Show Tables**\r\n\r\n```\r\nShow Tables;\r\n```\r\n\r\n```\r\nOutput:\r\n+-------------+\r\n| Tables      |\r\n+-------------+\r\n| test_data   |\r\n| Warriors    |\r\n+-------------+\r\n\r\nTotal number of Tables: 2\r\n```\r\n\r\nShows list of available csv files in the current directory which is used as the database.\r\n\r\n#### **Inserting Data**\r\n\r\n```\r\nInsert into Warriors (Name, Attack, Defense, PowerLevel) values (Goku, 5000, 7000, 9001), (Vegeta, 5000, 7000, 9000);\r\n```\r\n\r\nAppends records to `Warriors.csv`.\r\n\r\n#### **Fetching Data**\r\n\r\n```\r\nSelect * from Warriors;\r\n```\r\n\r\n```\r\nOutput:\r\n+--------+--------+---------+------------+\r\n| Name   | Attack | Defense | PowerLevel |\r\n+--------+--------+---------+------------+\r\n| Goku   |  5000  |   8000  |    9001    |\r\n| Vegeta |  5000  |   7000  |    9000    |\r\n+--------+--------+---------+------------+\r\n\r\n2 rows returned\r\n```\r\n\r\n#### **Using WHERE Clauses**\r\n\r\n```\r\nSelect Name from Warriors Where PowerLevel \u003e 9000;\r\n```\r\n\r\n```\r\nOutput:\r\n+--------+\r\n| Name   |\r\n+--------+\r\n| Goku   |\r\n+--------+\r\n\r\n1 rows returned\r\n```\r\n\r\n#### **Updating Data**\r\n\r\n```\r\nUpdate Table Warriors set PowerLevel = 10000, Defense = 8000 Where Name = Goku;\r\nSelect * from Warriors;\r\n```\r\n\r\n```\r\nOutput:\r\n+--------+--------+---------+------------+\r\n| Name   | Attack | Defense | PowerLevel |\r\n+--------+--------+---------+------------+\r\n| Goku   |  5000  |   8000  |    10000   |\r\n| Vegeta |  5000  |   7000  |    9000    |\r\n+--------+--------+---------+------------+\r\n\r\n2 rows returned\r\n```\r\n\r\n#### **Deleting Data**\r\n\r\n```\r\nDelete From Warriors Where PowerLevel \u003c 10000;\r\nSelect * from Warriors;\r\n```\r\n\r\n```\r\nOutput:\r\n+--------+--------+---------+------------+\r\n| Name   | Attack | Defense | PowerLevel |\r\n+--------+--------+---------+------------+\r\n| Goku   |  5000  |   7000  |    10000   |\r\n+--------+--------+---------+------------+\r\n\r\n1 rows returned\r\n```\r\n\r\n---\r\n\r\n## Order by clause\r\n\r\nThe default ordering is ascending order (`asc`,`Asc`,`ASC`)\u003cbr/\u003eThe descending order can be used as (`desc`,`Desc`,`DESC`)\r\n\r\n### Examples\r\n\r\n```\r\nSelect * from test_data order by Defense;\r\n```\r\n\r\n```\r\nOutput:\r\n+--------------------+---------+---------+-------------+\r\n| Name               | Attack  | Defense | PowerLevel  |\r\n+--------------------+---------+---------+-------------+\r\n| Karin_Uzumaki      | 100     | 92      | 510         |\r\n| Jayden_Uchiha      | 200     | 120     | 5000        |\r\n| Rykon_Hayashi      | 400     | 310     | 8100        |\r\n| Arkon_Hayashi      | 420     | 330     | 8000        |\r\n| Kakarot_Uchiha     | 500     | 340     | 9001        |\r\n| Drago_Uzumaki      | 460     | 350     | 8010        |\r\n+--------------------+---------+---------+-------------+\r\n\r\n6 rows returned\r\n```\r\n\r\n```\r\nSelect * from test_data where Attack \u003e 200 order by Defense desc;\r\n```\r\n\r\n```\r\nOutput:\r\n+--------------------+---------+---------+-------------+\r\n| Name               | Attack  | Defense | PowerLevel  |\r\n+--------------------+---------+---------+-------------+\r\n| Drago_Uzumaki      | 460     | 350     | 8010        |\r\n| Kakarot_Uchiha     | 500     | 340     | 9001        |\r\n| Arkon_Hayashi      | 420     | 330     | 8000        |\r\n| Rykon_Hayashi      | 400     | 310     | 8100        |\r\n+--------------------+---------+---------+-------------+\r\n\r\n4 rows returned\r\n```\r\n\r\n```\r\nSelect Name, PowerLevel, Defense from test_data where Attack \u003e 200 Order by Defense;\r\n```\r\n\r\n```\r\nOutput:\r\n+--------------------+-------------+---------+\r\n| Name               | PowerLevel  | Defense |\r\n+--------------------+-------------+---------+\r\n| Rykon_Hayashi      | 8100        | 310     |\r\n| Arkon_Hayashi      | 8000        | 330     |\r\n| Kakarot_Uchiha     | 9001        | 340     |\r\n| Drago_Uzumaki      | 8010        | 350     |\r\n+--------------------+-------------+---------+\r\n\r\n4 rows returned\r\n```\r\n\r\n---\r\n\r\n## Error Handling\r\n\r\nKaizer-DB provides meaningful error messages to guide users.\r\n#### Example\r\n\r\n```\r\nSelect Name, PowerLevel from Warriors Where Attack \u003e 200 Order by Defense;\r\n```\r\n\r\n```\r\nOutput:\r\nError: Order by field needs to be included in fetch list\r\n```\r\n\r\n---\r\n\r\n\u003ch2 style=\"color: #1E90FF;\"\u003e👥 Contributors 👥\u003c/h2\u003e \r\n\u003ctable style=\"background-color: #E6F7FF; border-radius: 10px; box-shadow: 0 4px 8px rgba(30, 144, 255, 0.2);\"\u003e\r\n  \u003ctr\u003e\r\n    \u003ctd\u003e\r\n      \u003ca href=\"https://github.com/DarkMortal\"\u003e \r\n        \u003cimg src=\"https://github.com/DarkMortal.png\" width=\"100px;\" alt=\"DarkMortal\"/\u003e\u003cbr /\u003e \r\n        \u003csub\u003e\u003cb\u003eDarkMortal\u003c/b\u003e\u003c/sub\u003e \r\n      \u003c/a\u003e\r\n    \u003c/td\u003e\r\n    \u003ctd\u003e\r\n      \u003ca href=\"https://github.com/dpgaharwal\"\u003e \r\n        \u003cimg src=\"https://github.com/dpgaharwal.png\" width=\"100px;\" alt=\"dpgaharwal\"/\u003e\u003cbr /\u003e \r\n        \u003csub\u003e\u003cb\u003edpgaharwal\u003c/b\u003e\u003c/sub\u003e \r\n      \u003c/a\u003e \r\n    \u003c/td\u003e\r\n    \u003ctd\u003e\r\n      \u003ca href=\"https://github.com/adwityac\"\u003e \r\n        \u003cimg src=\"https://github.com/adwityac.png\" width=\"100px;\" alt=\"adwityac\"/\u003e\u003cbr /\u003e \r\n        \u003csub\u003e\u003cb\u003eadwityac\u003c/b\u003e\u003c/sub\u003e \r\n      \u003c/a\u003e \r\n    \u003c/td\u003e\r\n    \u003ctd\u003e\r\n      \u003ca href=\"https://github.com/aprajitapandeyxcghd\"\u003e \r\n        \u003cimg src=\"https://github.com/aprajitapandeyxcghd.png\" width=\"100px;\" alt=\"aprajitapandeyxcghd\"/\u003e\u003cbr /\u003e \r\n        \u003csub\u003e\u003cb\u003eaprajitapandeyxcghd\u003c/b\u003e\u003c/sub\u003e \r\n      \u003c/a\u003e \r\n    \u003c/td\u003e\r\n    \u003ctd\u003e\r\n      \u003ca href=\"https://github.com/GauravKarakoti\"\u003e \r\n        \u003cimg src=\"https://github.com/GauravKarakoti.png\" width=\"100px;\" alt=\"GauravKarakoti\"/\u003e\u003cbr /\u003e \r\n        \u003csub\u003e\u003cb\u003eGauravKarakoti\u003c/b\u003e\u003c/sub\u003e \r\n      \u003c/a\u003e \r\n    \u003c/td\u003e\r\n  \u003c/tr\u003e\r\n\u003c/table\u003e\r\n\r\n\u003ch3\u003e\r\n    We welcome contributions to Kaizer-DB. Follow these steps to get started:\r\n\u003c/h3\u003e\r\n\r\n1. **Fork the Repository**\r\n   Fork the Repository by using fork button.\r\n2. **Clone the Repository**\r\n\r\n```bash\r\ngit clone https://github.com/\u003ccontributor-user-name\u003e/Kaizer-DB.git\r\n```\r\n\r\n3. **Create a New Branch**\r\n\r\n```bash\r\ncd Kaizer-DB\r\ngit checkout -b feature/your-feature-name\r\n```\r\n\r\n4. **Make Your Changes**\r\n\r\n- Edit the code as needed.\r\n- Add tests if applicable.\r\n- Update the version details in `package.json` file.\r\n\r\n5. **Commit Your Changes**\r\n\r\n```bash\r\ngit add .\r\ngit commit -m \"Description of your changes\"\r\n```\r\n\r\n6. **Push Your Changes**\r\n\r\n```bash\r\ngit push origin feature/your-feature-name\r\n```\r\n\r\n7. **Create a Pull Request (PR)**\r\n\r\n- Go to your repository on GitHub.\r\n- Click on **New Pull Request**.\r\n- Provide a detailed description of your changes.\r\n- Submit the PR for review.\r\n\u003chr/\u003e\r\n\u003ch2 style=\"color: #1E90FF;\"\u003e📜 License 📜\u003c/h2\u003e \u003cp\u003eMIT License © 2025 DarkMortal\u003c/p\u003e \r\n\u003chr/\u003e\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkmortal%2Fkaizer-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarkmortal%2Fkaizer-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkmortal%2Fkaizer-db/lists"}