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
Release history Release notifications | RSS feed
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.1.tar.gz
(10.0 kB
view details)
File details
Details for the file aiopg-0.1.1.tar.gz.
File metadata
- Download URL: aiopg-0.1.1.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27a9b0d9a2cb3862eaca136b0f6a62a0165fa9303141b00a9923e0d14c48e82e
|
|
| MD5 |
052a055bc444be1b5da9d06b7fee299c
|
|
| BLAKE2b-256 |
5279310698842f174ca14ba82e259b821af5e71453b67b23b83b3b770b9bea44
|