2017 © Pedro Peláez
 

library postgres

Asynchronous PostgreSQL client for Icicle.

image

icicleio/postgres

Asynchronous PostgreSQL client for Icicle.

  • Monday, May 9, 2016
  • by Trowski
  • Repository
  • 2 Watchers
  • 4 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

PostgreSQL Client for Icicle

This library is a component for Icicle that provides an asynchronous client for PostgreSQL. Like other Icicle components, this library uses Coroutines built from Awaitables and Generators to make writing asynchronous code more like writing synchronous code., (*1)

Build Status Coverage Status Semantic Version MIT License @icicleio on Twitter, (*2)

Documentation and Support

Requirements
  • PHP 5.5+ for v0.1.x branch
  • PHP 7 for v1.0 (v1.x branch and master) supporting generator delegation and return expressions
Installation

The recommended way to install is with the Composer package manager. (See the Composer installation guide for information on installing and using Composer.), (*3)

Run the following command to use this library in your project:, (*4)

composer require icicleio/postgres

You can also manually edit composer.json to add this library as a project requirement., (*5)

// composer.json
{
    "require": {
        "icicleio/postgres": "^0.1"
    }
}

Example

Note that this example uses the PHP 7+ only v1.x (master) branch., (*6)

#!/usr/bin/env php
<?php

require __DIR__ . '/vendor/autoload.php';

use Icicle\Postgres;

Icicle\execute(function () {
    /** @var \Icicle\Postgres\Connection $connection */
    $connection = yield from Postgres\connect('host=localhost user=postgres dbname=test');

    /** @var \Icicle\Postgres\Statement $statement */
    $statement = yield from $connection->prepare('SELECT * FROM test WHERE id=$1');

    /** @var \Icicle\Postgres\TupleResult $result */
    $result = yield from $statement->execute(1337);

    $iterator = $result->getIterator();

    while (yield from $iterator->isValid()) {
        $row = $iterator->getCurrent();
        // $row is an array (map) of column values. e.g.: $row['column_name']
    }
});

The Versions

09/05 2016

v1.x-dev

1.9999999.9999999.9999999-dev http://icicle.io

Asynchronous PostgreSQL client for Icicle.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Aaron Piotrowski

database postgresql asynchronous async db pgsql postgre

09/05 2016

dev-master

9999999-dev http://icicle.io

Asynchronous PostgreSQL client for Icicle.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Aaron Piotrowski

database postgresql asynchronous async db pgsql postgre

09/05 2016

v0.1.x-dev

0.1.9999999.9999999-dev http://icicle.io

Asynchronous PostgreSQL client for Icicle.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Aaron Piotrowski

database postgresql asynchronous async db pgsql postgre