2017 © Pedro Peláez
 

library postgres

Asynchronous PostgreSQL client for Amp.

image

amphp/postgres

Asynchronous PostgreSQL client for Amp.

  • Wednesday, July 18, 2018
  • by kelunik
  • Repository
  • 6 Watchers
  • 23 Stars
  • 380 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 5 Forks
  • 3 Open issues
  • 9 Versions
  • 89 % Grown

The README.md

amphp/postgres

AMPHP is a collection of event-driven libraries for PHP designed with fibers and concurrency in mind. amphp/postgres is an asynchronous Postgres client. The library implements concurrent querying by transparently distributing queries across a scalable pool of available connections. Either ext-pgsql (bundled with PHP) or pecl-pq are required., (*1)

Features

  • Exposes a non-blocking API for issuing multiple Postgres queries concurrently
  • Transparent connection pooling to overcome Postgres' fundamentally synchronous connection protocol
  • Support for parameterized prepared statements
  • Nested transactions with commit and rollback event hooks
  • Unbuffered results to reduce memory usage for large result sets
  • Support for sending and receiving notifications

Installation

This package can be installed as a Composer dependency., (*2)

composer require amphp/postgres

Requirements

Note: pecl-ev is not compatible with ext-pgsql. If you wish to use pecl-ev for the event loop backend, you must use pecl-pq., (*3)

Documentation & Examples

Prepared statements and parameterized queries support named placeholders, as well as ? and standard numeric (i.e. $1) placeholders., (*4)

Row values are cast to their corresponding PHP types. For example, integer columns will be an int in the result row array., (*5)

More examples can be found in the examples directory., (*6)

use Amp\Postgres\PostgresConfig;
use Amp\Postgres\PostgresConnectionPool;

$config = PostgresConfig::fromString("host=localhost user=postgres db=test");

$pool = new PostgresConnectionPool($config);

$statement = $pool->prepare("SELECT * FROM test WHERE id = :id");

$result = $statement->execute(['id' => 1337]);
foreach ($result as $row) {
    // $row is an associative-array of column values, e.g.: $row['column_name']
}

Versioning

amphp/postgres follows the semver semantic versioning specification like all other amphp packages., (*7)

Security

If you discover any security related issues, please use the private security issue reporter instead of using the public issue tracker., (*8)

License

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

The Versions

18/07 2018

dev-squash

dev-squash http://amphp.org

Asynchronous PostgreSQL client for Amp.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Aaron Piotrowski

database postgresql asynchronous async db pgsql postgre

01/07 2018

dev-fix/sql-interfaces-pr

dev-fix/sql-interfaces-pr http://amphp.org

Asynchronous PostgreSQL client for Amp.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Aaron Piotrowski

database postgresql asynchronous async db pgsql postgre

28/06 2018

dev-master

9999999-dev http://amphp.org

Asynchronous PostgreSQL client for Amp.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Aaron Piotrowski

database postgresql asynchronous async db pgsql postgre

15/12 2017

v0.2.1

0.2.1.0 http://amphp.org

Asynchronous PostgreSQL client for Amp.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Aaron Piotrowski

database postgresql asynchronous async db pgsql postgre

12/12 2017

v0.2.0

0.2.0.0 http://amphp.org

Asynchronous PostgreSQL client for Amp.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Aaron Piotrowski

database postgresql asynchronous async db pgsql postgre

19/11 2017

dev-travis

dev-travis http://amphp.org

Asynchronous PostgreSQL client for Amp.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Aaron Piotrowski

database postgresql asynchronous async db pgsql postgre

28/07 2017

v0.1.2

0.1.2.0 http://amphp.org

Asynchronous PostgreSQL client for Amp.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Aaron Piotrowski

database postgresql asynchronous async db pgsql postgre

22/06 2017

v0.1.1

0.1.1.0 http://amphp.org

Asynchronous PostgreSQL client for Amp.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Aaron Piotrowski

database postgresql asynchronous async db pgsql postgre

21/06 2017

v0.1.0

0.1.0.0 http://amphp.org

Asynchronous PostgreSQL client for Amp.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Aaron Piotrowski

database postgresql asynchronous async db pgsql postgre