{"id":20877702,"url":"https://github.com/dafrok/mysql-backup","last_synced_at":"2025-05-12T16:30:57.802Z","repository":{"id":57306786,"uuid":"120438274","full_name":"Dafrok/mysql-backup","owner":"Dafrok","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-06T07:59:26.000Z","size":50,"stargazers_count":6,"open_issues_count":6,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T07:08:55.649Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Dafrok.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":"2018-02-06T10:24:37.000Z","updated_at":"2023-11-17T10:41:48.000Z","dependencies_parsed_at":"2024-06-19T17:36:30.156Z","dependency_job_id":"dd355c3f-bd62-4411-a35a-7f90cbd54624","html_url":"https://github.com/Dafrok/mysql-backup","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/Dafrok%2Fmysql-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dafrok%2Fmysql-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dafrok%2Fmysql-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dafrok%2Fmysql-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dafrok","download_url":"https://codeload.github.com/Dafrok/mysql-backup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225141829,"owners_count":17427362,"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-18T06:58:18.522Z","updated_at":"2024-11-18T06:58:20.129Z","avatar_url":"https://github.com/Dafrok.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mysql Backup\n\nCreate a backup from MySQL.\nA modern version of [mysqldump](https://github.com/webcaetano/mysqldump), but it's not to create a file, to output a string instead.\n\n## Installation\n\n```\nnpm install mysql-backup\n```\n\n## Get Start\n\n## Example\n\n```javascript\nconst mysqlBackup = require('mysql-backup')\n\nmysqlBackup({\n  host: 'localhost',\n  user: 'root',\n  password: '',\n  database: 'test',\n}).then(dump =\u003e {\n  console.log(dump)\n})\n```\n\n### Full Options Example\n\n```javascript\nconst mysqlBackup = require('mysqldump')\nconst fs = require('fs')\n\nmysqlBackup({\n  host: 'localhost',\n  user: 'root',\n  password: '',\n  database: 'test',\n  tables:['players'], // only these tables\n  where: {'players': 'id \u003c 1000'}, // Only test players with id \u003c 1000\n  ifNotExist:true, // Create table if not exist\n}).then(dump =\u003e {\n  fs.writeFileSync('test.sql', dump) // Create data.sql file with dump result\n})\n```\n\n## Options\n\n\n#### host\n\nType: `String`\n\nUrl to Mysql host. `Default: localhost`\n\n#### port\n\nType: `String`\n\nPort to Mysql host. `Default: 3306`\n\n#### user\n\nType: `String`\n\nThe MySQL user to authenticate as.\n\n#### password\n\nType: `String`\n\nThe password of that MySQL user\n\n#### database\n\nType: `String`\n\nName of the database to dump.\n\n#### tables \n\nType: `Array`\n\nArray of tables that you want to backup.\n\nLeave Blank for All. `Default: [] ALL`\n\n#### schema \n\nType: `Boolean`\n\nOutput table structure `Default: true`;\n\n#### data \n\nType: `Boolean`\n\nOutput table data for ALL tables `Default: true`;\n\n#### where\nType: `Object`\n\nWhere clauses to limit dumped data `Example: where: {'users': 'id \u003c 1000'}`\n\nCombine with `data: false` to only dump tables with where clauses  `Default: null`;\n\n#### ifNotExist \n\nType: `Boolean`\n\nCreate tables if not exist method `Default: true`;\n\n#### dropTable \n\nType: `Boolean`\n\nDrop tables if exist `Default: false`;\n\n#### getDump \n\nType: `Boolean`\n\nReturn dump as a raw data on callback instead of create file `Default: false`;\n\n#### socketPath\n\nType: `String`\n\nPath to a unix domain socket to connect to. When used `host` and `port` are ignored.\n\n[![npm](https://nodei.co/npm/mysql-backup.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://www.npmjs.com/package/mysql-backup)\n\n---------------------------------\n\nThe MIT [License](https://raw.githubusercontent.com/webcaetano/mysqldump/master/LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdafrok%2Fmysql-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdafrok%2Fmysql-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdafrok%2Fmysql-backup/lists"}