{"id":18595016,"url":"https://github.com/eugabrielsilva/sql-dumper","last_synced_at":"2025-09-10T00:45:44.520Z","repository":{"id":61712391,"uuid":"554204552","full_name":"eugabrielsilva/sql-dumper","owner":"eugabrielsilva","description":"SQL backup dumper made in pure PHP","archived":false,"fork":false,"pushed_at":"2023-05-25T13:06:00.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-19T07:21:32.625Z","etag":null,"topics":["backup","php","sql"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/eugabrielsilva/sql-dumper","language":"PHP","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/eugabrielsilva.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-10-19T12:26:57.000Z","updated_at":"2023-05-25T13:07:35.000Z","dependencies_parsed_at":"2024-12-26T20:42:00.370Z","dependency_job_id":"3f612f3b-3b54-444c-99ee-1b01db9eb298","html_url":"https://github.com/eugabrielsilva/sql-dumper","commit_stats":{"total_commits":4,"total_committers":2,"mean_commits":2.0,"dds":0.25,"last_synced_commit":"b722cfac1fcbaec832e3570ed886e3ed33aa6c88"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/eugabrielsilva/sql-dumper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eugabrielsilva%2Fsql-dumper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eugabrielsilva%2Fsql-dumper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eugabrielsilva%2Fsql-dumper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eugabrielsilva%2Fsql-dumper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eugabrielsilva","download_url":"https://codeload.github.com/eugabrielsilva/sql-dumper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eugabrielsilva%2Fsql-dumper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274390719,"owners_count":25276408,"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","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["backup","php","sql"],"created_at":"2024-11-07T01:18:04.148Z","updated_at":"2025-09-10T00:45:43.947Z","avatar_url":"https://github.com/eugabrielsilva.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SQLDumper\nThis is a PHP package designed to generate an **SQL dump from a MySQL database using pure PHP**, without needing to rely on `mysqldump` or other tools.\n\n\u003ca href=\"https://packagist.org/packages/eugabrielsilva/sql-dumper\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/eugabrielsilva/sql-dumper\" alt=\"Latest Version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/eugabrielsilva/sql-dumper\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/packagist/dt/eugabrielsilva/sql-dumper\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/eugabrielsilva/sql-dumper\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/github/license/eugabrielsilva/sql-dumper\" alt=\"License\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/eugabrielsilva/sql-dumper\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/packagist/php-v/eugabrielsilva/sql-dumper\" alt=\"PHP Version\"\u003e\u003c/a\u003e\n\n### Requirements\n- PHP version 7.4 or higher with **mysqli** and **mbstring** extensions enabled\n- MySQL server and a user with `SHOW` and `SELECT` privileges\n\n### Installation\n**Through Composer:**\n```\ncomposer require eugabrielsilva/sql-dumper\n```\n\n**Manual installation:**\\\nCopy `src/SQLDumper.php` and include it in your script.\n\n### Usage\n```php\n// Include Composer packages if not yet\nrequire 'vendor/autoload.php';\n\n// Create SQLDumper instance\n$db = new \\GabrielSilva\\SQLDumper\\SQLDumper();\n\n// Set your server settings (optional)\n$db-\u003ehost = 'localhost';\n$db-\u003euser = 'root';\n$db-\u003epassword = '';\n$db-\u003edb = 'app';\n\n// Generate dump to an SQL file\n$db-\u003edumpToFile('backup.sql');\n\n// You can also dump to a string\n$dump = $db-\u003edumpToString();\n```\n\n### Options\nThere are a few options that you can use to modify SQLDumper, these options are properties from the instance that can be overwritten.\n\n**Note:** values shown below are the default ones.\n\n```php\n$db-\u003ehost = 'localhost'; // Server hostname\n$db-\u003euser = 'root'; // Username to connect to the database\n$db-\u003epassword = ''; // User password\n$db-\u003edb = 'app'; // Database name\n$db-\u003eport = 3306; // Server port\n$db-\u003echarset = 'utf8'; // Database charset\n$db-\u003eincludes = []; // Array of tables to include in dump, empty for all\n$db-\u003eexcludes = []; // Array of tables to exclude from dump\n$db-\u003ecreateTables = true; // Include CREATE TABLE statements in dump\n$db-\u003ecreateDatabase = false; // Include CREATE DATABASE statement in dump\n$db-\u003edropTables = false; // Include DROP TABLE statements in dump\n$db-\u003edropDatabase = false; // Include DROP DATABASE statement in dump\n$db-\u003einsertData = true; // Include data in dump\n$db-\u003edeleteData = false; // Delete data from table before inserting\n$db-\u003einsertType = 'INSERT'; // Insert type: INSERT, INSERT IGNORE or REPLACE\n$db-\u003esafeMode = true; // Use IF EXISTS and IF NOT EXISTS clauses in dump\n$db-\u003echunkSize = 3000; // Number of rows to fetch per query (useful in large tables)\n```\n\n**Important!** If you change any of the server options, like `host`, `user`, `password`, `db`, `port` or `charset`, you need to refresh the database connection using `$db-\u003econnect()` method.\n\n### Credits\nLibrary developed and currently maintained by [Gabriel Silva](https://github.com/eugabrielsilva).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feugabrielsilva%2Fsql-dumper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feugabrielsilva%2Fsql-dumper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feugabrielsilva%2Fsql-dumper/lists"}