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 (XXXX-XX-XX)

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.0.tar.gz (10.0 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for aiopg-0.1.0.tar.gz
Algorithm Hash digest
SHA256 30776ee2d0d27089153a64c242ac805d0b83f6768d718f6bef29e3cea648e5f7
MD5 5090508ce6c4ac9b895179437568419b
BLAKE2b-256 078a7f466fc8fc2e4166407986a8ac11992adedb5f3f7f074583858529b9520a

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