{"id":20671150,"url":"https://github.com/allnulled/mysql-history","last_synced_at":"2025-03-10T17:22:19.431Z","repository":{"id":57306823,"uuid":"251394108","full_name":"allnulled/mysql-history","owner":"allnulled","description":"History database tables generation for Node.js and MySQL.","archived":false,"fork":false,"pushed_at":"2020-03-30T20:41:23.000Z","size":153,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-17T21:11:17.327Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/mysql-history","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/allnulled.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-03-30T18:30:28.000Z","updated_at":"2020-03-31T08:53:23.000Z","dependencies_parsed_at":"2022-08-28T21:10:41.835Z","dependency_job_id":null,"html_url":"https://github.com/allnulled/mysql-history","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/allnulled%2Fmysql-history","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allnulled%2Fmysql-history/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allnulled%2Fmysql-history/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allnulled%2Fmysql-history/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/allnulled","download_url":"https://codeload.github.com/allnulled/mysql-history/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242889642,"owners_count":20201997,"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":[],"created_at":"2024-11-16T20:25:29.957Z","updated_at":"2025-03-10T17:22:19.405Z","avatar_url":"https://github.com/allnulled.png","language":"JavaScript","readme":"# mysql-history\n\nHistorical database registry system for Node.js and MySQL databases\n\n## Installation\n\n`$ npm i -g mysql-history`\n\n## Usage\n\n### CLI usage\n\n```sh\n$ mysql-history\n    --command create\n    --schema-generation\n    --schema-user test\n    --schema-password test\n    --schema-database test\n    --schema-host 127.0.0.1\n    --schema-port 3306\n    --schema-output mydb.schema.js\n    --history-schema mydb.schema.js\n    --history-user test\n    --history-password test\n    --history-database test\n    --history-host 127.0.0.1\n    --history-port 3306\n```\n\n\n### API usage\n\n```js\nconst history = require(\"mysql-history\").create({\n\tschema: {\n\t\tgeneration: true,\n\t\tuser: \"admin\",\n\t\tpassword: \"admin123\",\n\t\tdatabase: \"app_database\",\n\t\thost: \"127.0.0.1\",\n\t\tport: 3306,\n\t\tconfigurations: undefined,\n\t\textensions: {},\n\t\toutput: __dirname + \"/db1.schema.js\"\n\t\t// debug: true,\n\t},\n\thistory: {\n\t\tuser: \"history_user\",\n\t\tpassword: \"history123\",\n\t\tdatabase: \"app_history\",\n\t\thost: \"127.0.0.1\",\n\t\tport: 3306,\n\t\tschema: [\n\t\t\t__dirname + \"/db1.schema.js\",\n\t\t\t// you can add other schemas too...\n\t\t],\n\t\t// debug: true,\n\t}\n});\n\nconst execution = async function() {\n\tawait history.initialize(); // generates the schema, prepares templates and others\n\tawait history.createTables(); // creates the database history tables\n\tawait history.save(\"db1\", \"my_table\", [{value:1},{value:2},{value:3}]);\n\tawait history.save(\"db1\", \"my_table\", [{value:4},{value:5},{value:6}]);\n\tawait history.save(\"db1\", \"my_table\", [{value:7},{value:8},{value:9}]);\n\tawait history.deleteTables(); // deletes the database history tables\n};\n\nmodule.exports = execution();\n```\n\n## API Reference\n\n\n\n\n\n## Issues\n\nPlease, report issues and suggestions [here](https://github.com/allnulled/mysql-history/issues).\n\n## License\n\nThis project is licensed under [WTFPL or What The Fuck Public License](http://www.wtfpl.net/), which means 'do what you want with it'.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallnulled%2Fmysql-history","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallnulled%2Fmysql-history","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallnulled%2Fmysql-history/lists"}