1
0
mirror of https://github.com/danog/postgres.git synced 2024-11-30 04:29:12 +01:00
Go to file
2017-12-11 19:10:14 -06:00
examples Rename TupleResult to ResultSet 2017-12-02 19:35:49 -06:00
lib Add phpstan & fix some doc issues 2017-12-11 19:10:14 -06:00
test Update pool connection creation 2017-12-10 09:53:52 -06:00
travis Move extension installation to separate scripts 2017-05-26 16:33:11 -05:00
.gitattributes Update export-ignore files 2017-11-22 20:35:23 -06:00
.gitignore Use code fixer 2017-05-15 23:27:47 -05:00
.php_cs.dist Update and fix code styles 2017-06-20 22:59:42 -05:00
.travis.yml Define target platform in composer.json and fix .travis.yml 2017-12-02 19:53:38 -06:00
composer.json Add phpstan & fix some doc issues 2017-12-11 19:10:14 -06:00
LICENSE Initial commit 2016-09-14 09:27:39 -05:00
Makefile Add Makefile 2017-06-20 23:04:23 -05:00
phpdoc.dist.xml Initial commit 2016-09-14 09:27:39 -05:00
phpunit.xml.dist Update to PHPUnit 6 2017-05-26 10:47:44 -05:00
README.md Update readme 2017-12-08 20:43:05 -06:00

postgres

Build Status Code Coverage Release License

Async PostgreSQL client built with Amp.

Installation

This package can be installed as a Composer dependency.

composer require amphp/postgres

Requirements

Documentation & Examples

More examples can be found in the examples directory.

Amp\Loop::run(function () {
    /** @var \Amp\Postgres\Pool $pool */
    $pool = Amp\Postgres\pool("host=localhost user=postgres dbname=test");

    /** @var \Amp\Postgres\Statement $statement */
    $statement = yield $pool->prepare("SELECT * FROM test WHERE id=$1");

    /** @var \Amp\Postgres\ResultSet $result */
    $result = yield $statement->execute([1337]);
    while (yield $result->advance()) {
        $row = $result->getCurrent();
        // $row is an array (map) of column values. e.g.: $row['column_name']
    }
});

Versioning

amphp/postgres follows the semver semantic versioning specification like all other amphp packages.

Security

If you discover any security related issues, please email contact@amphp.org instead of using the issue tracker.

License

The MIT License (MIT). Please see LICENSE for more information.