{"id":25010441,"url":"https://github.com/guisalmeida/dbgen-cli","last_synced_at":"2025-06-15T11:08:11.883Z","repository":{"id":123867155,"uuid":"258889437","full_name":"guisalmeida/dbgen-cli","owner":"guisalmeida","description":"CLI to create a database with commans sql create with nodejs for study.","archived":false,"fork":false,"pushed_at":"2023-11-10T16:40:37.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-15T11:08:11.438Z","etag":null,"topics":["command-line-tool","database","nodejs","sql"],"latest_commit_sha":null,"homepage":"https://guisalmeida.com/meu-pr%C3%B3prio-sgdb-em-js-pelo-terminal/","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/guisalmeida.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.MD","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":"2020-04-25T22:45:09.000Z","updated_at":"2023-11-10T16:40:42.000Z","dependencies_parsed_at":"2023-11-10T17:48:17.689Z","dependency_job_id":null,"html_url":"https://github.com/guisalmeida/dbgen-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/guisalmeida/dbgen-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guisalmeida%2Fdbgen-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guisalmeida%2Fdbgen-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guisalmeida%2Fdbgen-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guisalmeida%2Fdbgen-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guisalmeida","download_url":"https://codeload.github.com/guisalmeida/dbgen-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guisalmeida%2Fdbgen-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259964330,"owners_count":22938724,"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":["command-line-tool","database","nodejs","sql"],"created_at":"2025-02-05T04:53:29.867Z","updated_at":"2025-06-15T11:08:11.867Z","avatar_url":"https://github.com/guisalmeida.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003ch1 align=\"center\"\u003e\n  DBgen-CLI\n\u003c/h1\u003e\n\n```sh\n      _ _                         ____ _     ___    ╔═════════╤═══════════════════╤═════════╗\n   __| | |__   __ _  ___ _ __    / ___| |   |_ _|   ║ Version │ Author            │ License ║\n  / _` | '_ \\ / _` |/ _ \\ '_ \\  | |   | |    | |    ╟─────────┼───────────────────┼─────────╢\n | (_| | |_) | (_| |  __/ | | | | |___| |___ | |    ║  0.1.0  │ Guilherme Almeida │   MIT   ║\n  \\__,_|_.__/ \\__, |\\___|_| |_|  \\____|_____|___|   ╚═════════╧═══════════════════╧═════════╝\n              |___/                              \n```\n\ndbgen-cli is a DBMS (Data Base Management System) used with CLI created to study the practices of sql commands, databases and JS ES6 features.  \n\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/45276342/121779626-03c74280-cb73-11eb-9aa7-6f7caa20c1e0.gif\" alt=\"dbgen-cli\" width=\"960\" height=\"auto\"/\u003e\u003c/p\u003e\n\n## __*Prerequisites*__\n\nYou should have installed the [node.js](https://nodejs.org/en/).\n\n## __*Installation*__\n\nClone this repo and use the [npm](https://www.npmjs.com/) to install the dependencies.\n\n```node\nnpm install -g dbgen-cli\n```\n\nCreate a global symlink for a dependency.\n\n```sh\nnpm link\n```\n\n## __*Usage*__\n\nIn the terminal type the following commands.\n\n```sh\nUsage:\n\u003ccommands\u003e -\u003e the keyword 'dbgen' followed by the quotation marks or single quotes\n\nCommands:\ncreate table \u003ctablename\u003e (\u003cfield \u0026 type\u003e)                       create a new table\ninsert into \u003ctablename\u003e (\u003cfieldname\u003e) values (\u003cfieldvalue\u003e)     insert values in fields\nselect [fields] or [*] from author [where] \u003ccondition\u003e          shows the selection table in the terminal\ndelete from \u003ctablename\u003e [where] \u003ccondition\u003e                     delete the selected table or selected field according to where condition\n\n```\n\n## __*Examples*__\n\n```sh\n# Create table \"authors\"\ndbgen \"create table authors (name varchar(50), age int, city varchar(50), state varchar(50), country varchar(50))\"\n\ndbgen \"select * from authors\"\n\n╔════╤══════╤═════╤══════╤═══════╤═════════╗\n║ ID │ NAME │ AGE │ CITY │ STATE │ COUNTRY ║\n╚════╧══════╧═════╧══════╧═══════╧═════════╝\n\n# Inserting records into the table\ndbgen \"insert into authors (name, age, city, country) values (Martin Fowler, 57, Walsall, England)\"\ndbgen \"insert into authors (name, age, city, country) values (Linus Torvalds, 51, Helsinki, Finland)\"\ndbgen \"insert into authors (name, age, state, country) values (Douglas Crockford, 66, Minnesota, EUA)\"\n\ndbgen \"select * from authors\"\n╔══════════╤═══════════════════╤═════╤══════════╤═══════════╤═════════╗\n║ ID       │ NAME              │ AGE │ CITY     │ STATE     │ COUNTRY ║\n╟──────────┼───────────────────┼─────┼──────────┼───────────┼─────────╢\n║ 5dbd7b0e │ Martin Fowler     │ 57  │ Walsall  │ null      │ England ║\n╟──────────┼───────────────────┼─────┼──────────┼───────────┼─────────╢\n║ 1fa31324 │ Linus Torvalds    │ 51  │ Helsinki │ null      │ Finland ║\n╟──────────┼───────────────────┼─────┼──────────┼───────────┼─────────╢\n║ 294e8872 │ Douglas Crockford │ 66  │ null     │ Minnesota │ EUA     ║\n╚══════════╧═══════════════════╧═════╧══════════╧═══════════╧═════════╝\n\n# Querying records with where\ndbgen \"select id, name, age from authors where name = Linus Torvalds\"\n╔══════════╤════════════════╤═════╗\n║ ID       │ NAME           │ AGE ║\n╟──────────┼────────────────┼─────╢\n║ 1fa31324 │ Linus Torvalds │ 51  ║\n╚══════════╧════════════════╧═════╝\n\n# Deleting records with where\ndbgen \"delete from authors where name = Martin Fowler\"\n\ndbgen \"select * from authors\"\n╔══════════╤═══════════════════╤═════╤══════════╤═══════════╤═════════╗\n║ ID       │ NAME              │ AGE │ CITY     │ STATE     │ COUNTRY ║\n╟──────────┼───────────────────┼─────┼──────────┼───────────┼─────────╢\n║ 1fa31324 │ Linus Torvalds    │ 51  │ Helsinki │ null      │ Finland ║\n╟──────────┼───────────────────┼─────┼──────────┼───────────┼─────────╢\n║ 294e8872 │ Douglas Crockford │ 66  │ null     │ Minnesota │ EUA     ║\n╚══════════╧═══════════════════╧═════╧══════════╧═══════════╧═════════╝\n```\n\nData written to the `/db.json` file\n```json\n{\n    \"authors\": {\n        \"columns\": {\n            \"id\": \"SERIAL NOT NULL\",\n            \"name\": \"varchar(50)\",\n            \"age\": \"int\",\n            \"city\": \"varchar(50)\",\n            \"state\": \"varchar(50)\",\n            \"country\": \"varchar(50)\"\n        },\n        \"data\": [\n            {\n                \"id\": \"1fa31324\",\n                \"name\": \"Linus Torvalds\",\n                \"age\": \"51\",\n                \"city\": \"Helsinki\",\n                \"country\": \"Finland\",\n                \"state\": \"null\"\n            },\n            {\n                \"id\": \"294e8872\",\n                \"name\": \"Douglas Crockford\",\n                \"age\": \"66\",\n                \"state\": \"Minnesota\",\n                \"country\": \"EUA\",\n                \"city\": \"null\"\n            }\n        ]\n    }\n}\n```\n\n## __*Built With*__\n\n* [nodeJS](https://nodejs.org/) - With the modules crypto and fs.\n* [cli-table](https://github.com/Automattic/cli-table) - Used to display tables in the terminal.\n* [figlet](https://github.com/patorjk/figlet.js) - Used to making large letters of logo.\n* [chalk](https://github.com/chalk/chalk) - Used to logging of colored information.\n\n## __*Author*__\n\n[**Guilherme Almeida**](https://guisalmeida.com)\n\nSee also the list of [contributors](https://github.com/GuiSAlmeida/dbgen-cli/contributors) who participated in this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguisalmeida%2Fdbgen-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguisalmeida%2Fdbgen-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguisalmeida%2Fdbgen-cli/lists"}