{"id":27440331,"url":"https://github.com/ciochetta/learndb","last_synced_at":"2025-04-14T22:40:00.903Z","repository":{"id":55049112,"uuid":"323396738","full_name":"ciochetta/learndb","owner":"ciochetta","description":"Database project I've created for learning purposes ","archived":false,"fork":false,"pushed_at":"2021-01-21T02:54:20.000Z","size":405,"stargazers_count":27,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T17:15:37.531Z","etag":null,"topics":["database","javascript","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/ciochetta.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}},"created_at":"2020-12-21T16:55:27.000Z","updated_at":"2025-01-24T02:07:02.000Z","dependencies_parsed_at":"2022-08-14T10:10:10.993Z","dependency_job_id":null,"html_url":"https://github.com/ciochetta/learndb","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/ciochetta%2Flearndb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ciochetta%2Flearndb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ciochetta%2Flearndb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ciochetta%2Flearndb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ciochetta","download_url":"https://codeload.github.com/ciochetta/learndb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975311,"owners_count":21192198,"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":["database","javascript","nodejs"],"created_at":"2025-04-14T22:40:00.114Z","updated_at":"2025-04-14T22:40:00.844Z","avatar_url":"https://github.com/ciochetta.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LuisDB\n\n\u003e My study on how to create a database\n\nHello, this is the repository for my database project, I am trying to learn how to create a database from scratch using Node.js\n\nMy objective is to understand a little better how databases work internally\n\n## Installation\n\nYou need to have Node.js and NPM to install and use this project\n\n```sh\nnpm i learndb\n```\n\n## Usage\n\nyou can use this in two ways, either as an REPL or as a driver for the database\n\n### REPL\n\nIf you want to use this project as a REPL I would adivise to clone it instead of installing it, if you have it cloned, to access the REPL, all you need to do is type this on the terminal:\n\n```sh\nnode index.js repl\n```\n\n### REPL Commands\n\n#### using [database name]\n\nEither loads a database from the directory you are currently in or creates a database with the specified name if none exists\n\nExample: using test\n\n#### create [table name] [columns names]\n\ncreates a new table in the database with the specified columns\n\nExample:\n\n```sh\ncreate users username password\n```\n\n#### insert [table name] [columns values]\n\ninserts a new document in the specified table with the values passed\n\nExample:\n\n```sh\ninsert users luis p4ssw0rd\n```\n\n#### select [columns name or *] From [table name] [where?]\n\nreturns an array with the specified columsn from the database\n\nExample:\n\n```sh\nselect username from users\n```\n\n#### where [key] [operator] [value]\n\noptional parameter for the select command, compares the values from the table with the ones informed using the informed operator\n\nExample:\n\n```sh\nselect username from users where name = luis\n```\n\n### Driver\n\nto use this project as a driver, you need to install it on your project, require it from the modules:\n\n```js\nconst LuisDB = require(\"learndb\");\n```\n\nand then you have access the same same commands from the repl but with objects (kinda like mongodb)\n\nthere is only one function currently that transforms the objects into database actions\n\nevalObject\n\nIt acepts one parameter that should have this structure:\n\n```js\n{\n\ttype: \"keyword\",\n\tparams: keywordparams\n}\n```\n\nI actually have an repo with a test I've made using this database as a driver, this should help understand how it works\n\nhttps://github.com/ciochetta/testing-luisdb\n\n### Driver keywords and params\n\n### Using\n\n#### Params: database name\n\nExample\n\n```js\nLuisDB.evalObject({\n\ttype: \"using\",\n\tparams: \"databasename\",\n});\n```\n\n### Using\n\n#### Params: table, columns\n\n```js\nLuisDB.evalObject({\n\ttype: \"create\",\n\tparams: {\n\t\ttable: \"students\",\n\t\tcolumns: [\"name\", \"grade\"],\n\t},\n});\n```\n\n### Insert\n\n#### Params: table, document\n\n```js\nLuisDB.evalObject({\n\ttype: \"insert\",\n\tparams: {\n\t\ttable: \"students\",\n\t\tdocument: [\"luis\", 7],\n\t},\n});\n```\n\n## To do\n\nThese are the things I want to implement in this project, in order of importance\n\n- write documentation for: UPDATE, DELETE, BULK INSERT, CREATE INDEX\n- move documentation to another file\n- Support indexing\n- Create a CLI for global use\n- Create an authentication system\n- Support partitioning\n- Support migration from SQL schemas\n\n## Devlog\n\nI am documenting this project on Dev.to, in this url:\n\nhttps://dev.to/ciochetta/series/10300\n\n## Resources\n\nEvery resource I've used to study for this project, not in any particular order:\n\nhttps://www.stefanjudis.com/today-i-learned/how-to-create-your-own-node-js-repl/\n\nhttps://nodejs.org/api/repl.html\n\nhttps://cstack.github.io/db_tutorial/parts/part1.html\n\nhttps://www.youtube.com/watch?v=WNKw1tiskSM\n\nhttps://github.com/oguimbal/pgsql-ast-parser\n\nhttps://youtube.com/watch?v=TOb1tuEZ2X4\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fciochetta%2Flearndb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fciochetta%2Flearndb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fciochetta%2Flearndb/lists"}