{"id":15024899,"url":"https://github.com/amphp/postgres","last_synced_at":"2025-04-05T17:07:46.406Z","repository":{"id":41882011,"uuid":"68212229","full_name":"amphp/postgres","owner":"amphp","description":"Async Postgres client for PHP based on Amp.","archived":false,"fork":false,"pushed_at":"2024-03-10T17:07:50.000Z","size":818,"stargazers_count":88,"open_issues_count":2,"forks_count":20,"subscribers_count":12,"default_branch":"2.x","last_synced_at":"2024-05-05T09:42:22.170Z","etag":null,"topics":["amphp","async","php","postgres","postgresql"],"latest_commit_sha":null,"homepage":"","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/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":"2016-09-14T14:15:11.000Z","updated_at":"2024-06-18T12:56:05.493Z","dependencies_parsed_at":"2023-11-19T05:24:55.683Z","dependency_job_id":"937465d1-f205-4dfc-95a3-9efad175449b","html_url":"https://github.com/amphp/postgres","commit_stats":{"total_commits":307,"total_committers":9,"mean_commits":"34.111111111111114","dds":0.04885993485342022,"last_synced_commit":"ae918035116714b2ad16e22fb4c2441ccb064461"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amphp%2Fpostgres","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amphp%2Fpostgres/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amphp%2Fpostgres/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amphp%2Fpostgres/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amphp","download_url":"https://codeload.github.com/amphp/postgres/tar.gz/refs/heads/2.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247369952,"owners_count":20927928,"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","php","postgres","postgresql"],"created_at":"2024-09-24T20:01:08.667Z","updated_at":"2025-04-05T17:07:46.388Z","avatar_url":"https://github.com/amphp.png","language":"PHP","readme":"# amphp/postgres\n\nAMPHP is a collection of event-driven libraries for PHP designed with fibers and concurrency in mind.\n`amphp/postgres` is an asynchronous Postgres client.\nThe library implements concurrent querying by transparently distributing queries across a scalable pool of available connections. Either [ext-pgsql](https://secure.php.net/pgsql) (bundled with PHP) or [pecl-pq](https://pecl.php.net/package/pq) are required.\n\n## Features\n\n- Exposes a non-blocking API for issuing multiple Postgres queries concurrently\n- Transparent connection pooling to overcome Postgres' fundamentally synchronous connection protocol\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- Support for sending and receiving notifications\n\n## Installation\n\nThis package can be installed as a [Composer](https://getcomposer.org/) dependency.\n\n```bash\ncomposer require amphp/postgres\n```\n\n## Requirements\n\n- PHP 8.1+\n- [ext-pgsql](https://secure.php.net/pgsql) or [pecl-pq](https://pecl.php.net/package/pq)\n\nNote: [pecl-ev](https://pecl.php.net/package/ev) is not compatible with ext-pgsql. If you wish to use pecl-ev for the event loop backend, you must use pecl-pq.\n\n## Documentation \u0026 Examples\n\nPrepared statements and parameterized queries support named placeholders, as well as `?` and standard numeric (i.e. `$1`) placeholders.\n\nRow values are cast to their corresponding PHP types. For example, integer columns will be an `int` in the result row array.\n\nMore examples can be found in the [`examples`](examples) directory.\n\n```php\nuse Amp\\Postgres\\PostgresConfig;\nuse Amp\\Postgres\\PostgresConnectionPool;\n\n$config = PostgresConfig::fromString(\"host=localhost user=postgres db=test\");\n\n$pool = new PostgresConnectionPool($config);\n\n$statement = $pool-\u003eprepare(\"SELECT * FROM test 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/postgres` 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"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famphp%2Fpostgres","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famphp%2Fpostgres","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famphp%2Fpostgres/lists"}