{"id":16446584,"url":"https://github.com/amphp/mysql","last_synced_at":"2025-05-15T18:07:49.058Z","repository":{"id":23449063,"uuid":"26812788","full_name":"amphp/mysql","owner":"amphp","description":"An async MySQL client for PHP, optimizing database interactions with efficient non-blocking capabilities. Perfect for responsive, high-performance applications.","archived":false,"fork":false,"pushed_at":"2024-03-10T17:34:38.000Z","size":1197,"stargazers_count":346,"open_issues_count":6,"forks_count":62,"subscribers_count":24,"default_branch":"3.x","last_synced_at":"2024-05-05T09:42:22.176Z","etag":null,"topics":["amphp","async","mysql","php","revolt"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amphp.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":"2014-11-18T14:26:40.000Z","updated_at":"2024-06-18T11:14:48.010Z","dependencies_parsed_at":"2023-12-04T05:22:26.999Z","dependency_job_id":"b2db87f2-a62e-4832-b52a-3bcba112a0f7","html_url":"https://github.com/amphp/mysql","commit_stats":{"total_commits":335,"total_committers":21,"mean_commits":"15.952380952380953","dds":0.5522388059701493,"last_synced_commit":"dac7e7149da22ef4473c026efae5d307d8fd41b7"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amphp%2Fmysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amphp%2Fmysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amphp%2Fmysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amphp%2Fmysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amphp","download_url":"https://codeload.github.com/amphp/mysql/tar.gz/refs/heads/3.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254394722,"owners_count":22063984,"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":["amphp","async","mysql","php","revolt"],"created_at":"2024-10-11T09:48:10.643Z","updated_at":"2025-05-15T18:07:49.021Z","avatar_url":"https://github.com/amphp.png","language":"PHP","readme":"# amphp/mysql\n\nAMPHP is a collection of event-driven libraries for PHP designed with fibers and concurrency in mind.\n`amphp/mysql` is an asynchronous MySQL client.\nThe library implements concurrent querying by transparently distributing queries across a scalable pool of available connections. The client transparently distributes these queries across a scalable pool of available connections and does so using 100% userland PHP; there are *no external extension dependencies* (e.g. `ext/mysqli`, `ext/pdo`, etc.).\n\n## Features\n\n- Exposes a non-blocking API for issuing multiple MySQL queries concurrently\n- Transparent connection pooling to overcome MySQL's fundamentally synchronous connection protocol\n- MySQL transfer encoding support (gzip, TLS encryption)\n- Support for parameterized prepared statements\n- Nested transactions with commit and rollback event hooks\n- Unbuffered results to reduce memory usage for large result sets\n- *Full* MySQL protocol support including *all*\u003csup\u003e†\u003c/sup\u003e available commands asynchronously\n\n\u003csup\u003e† As documented in [official Mysql Internals Manual](https://dev.mysql.com/doc/internals/en/client-server-protocol.html)\u003c/sup\u003e\n\n## Installation\n\nThis package can be installed as a [Composer](https://getcomposer.org/) dependency.\n\n```bash\ncomposer require amphp/mysql\n```\n\n## Requirements\n\n- PHP 8.1+\n\n## Usage\n\nMore extensive code examples reside in the [`examples`](examples) directory.\n\n```php\nuse Amp\\Mysql\\MysqlConfig;\nuse Amp\\Mysql\\MysqlConnectionPool;\n\n$config = MysqlConfig::fromString(\n    \"host=localhost user=username password=password db=test\"\n);\n\n$pool = new MysqlConnectionPool($config);\n\n$statement = $pool-\u003eprepare(\"SELECT * FROM table_name WHERE id = :id\");\n\n$result = $statement-\u003eexecute(['id' =\u003e 1337]);\nforeach ($result as $row) {\n    // $row is an associative-array of column values, e.g.: $row['column_name']\n}\n```\n\n## Versioning\n\n`amphp/mysql` follows the [semver](http://semver.org/) semantic versioning specification like all other `amphp` packages.\n\n## Security\n\nIf you discover any security related issues, please use the private security issue reporter instead of using the public issue tracker.\n\n## License\n\nThe MIT License (MIT). Please see [`LICENSE`](./LICENSE) for more information.\n","funding_links":[],"categories":["Database","📌 Covered Topics"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famphp%2Fmysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famphp%2Fmysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famphp%2Fmysql/lists"}