Skip to main content

Postgress integration with asyncio.

Project description

aiopg

aiopg is a library for accessing a PostgreSQL database from the asyncio (PEP-3156/tulip) framework. It wraps asynchronous features of the Psycopg database driver.

Example

import asyncio
from aiopg.pool import create_pool

dsn = 'dbname=jetty user=nick password=1234 host=localhost port=5432'


@asyncio.coroutine
def test_select():
    pool = yield from create_pool(dsn)

    with (yield from pool) as conn:
        cur = yield from conn.cursor()
        yield from cur.execute('SELECT 1')
        ret = yield from cur.fetchone()
        assert ret == (1,), ret

loop = asyncio.get_event_loop()
loop.run_until_complete(test_select())

CHANGES

0.1.0 (2014-04-06)

Implemented plain connections: connect, Connection, Cursor

Implemented database pools: create_pool and Pool

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiopg-0.1.2.tar.gz (7.1 kB view details)

Uploaded Source

File details

Details for the file aiopg-0.1.2.tar.gz.

File metadata

  • Download URL: aiopg-0.1.2.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for aiopg-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f7f8c74e6d7f2d694571dd45d8e28159ef08d1b4a5a7f20d2e8a41764cee7294
MD5 7088f091db18c7d6b0fb91302c733424
BLAKE2b-256 a0034ee297f518fb3f93017ae5e23ce99fdbef1e8ae6bd7228ce2ee94d59d16d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page