文件名称:Python的PostgreSQL异步驱动aiopg.zip
文件大小:98KB
文件格式:ZIP
更新时间:2022-08-07 14:11:29
开源项目
aiopg 是一个使用 asyncio (PEP-3156/tulip) 框架开发的用来访问 PostgreSQL 数据库的 Python 开发库,封装了基于 Psycopg 数据库驱动程序的异步特性。 示例代码: 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 asyncio.get_event_loop().run_until_complete(test_select()) 标签:aiopg
【文件预览】:
aiopg-master
----MANIFEST.in(109B)
----ACKS.txt(491B)
----README.rst(3KB)
----CONTRIBUTING.rst(2KB)
----LICENSE.txt(1KB)
----requirements.txt(216B)
----MAINTAINERS.txt(185B)
----examples()
--------sa_oldstyle.py(4KB)
--------simple_old_style.py(391B)
--------transaction.py(1KB)
--------simple_sa_oldstyle.py(1KB)
--------transaction_oldsyle.py(1KB)
--------sa.py(4KB)
--------notify_old_style.py(1KB)
--------simple_sa.py(991B)
--------notify.py(1KB)
--------simple.py(531B)
----.travis.yml(1KB)
----setup.cfg(79B)
----setup.py(2KB)
----Makefile(1KB)
----CHANGES.txt(5KB)
----docs()
--------glossary.rst(3KB)
--------make.bat(7KB)
--------contributing.rst(58B)
--------sa.rst(19KB)
--------conf.py(9KB)
--------core.rst(34KB)
--------index.rst(5KB)
--------examples.rst(2KB)
--------Makefile(7KB)
----aiopg()
--------cursor.py(13KB)
--------transaction.py(5KB)
--------pool.py(10KB)
--------utils.py(5KB)
--------sa()
--------log.py(124B)
--------__init__.py(2KB)
--------connection.py(18KB)
----tests()
--------dump.txt(1KB)
--------test_extended_types.py(1KB)
--------test_sa_transaction.py(11KB)
--------test_pool.py(15KB)
--------test_sa_types.py(5KB)
--------test_sa_default.py(3KB)
--------test_sa_cursor.py(3KB)
--------test_sa_connection.py(10KB)
--------pep492()
--------test_connection.py(17KB)
--------test_sa_distil.py(2KB)
--------conftest.py(12KB)
--------test_cursor.py(8KB)
--------test_version.py(751B)
--------test_transaction.py(6KB)
--------test_sa_engine.py(3KB)
----.gitignore(114B)
----.coveragerc(91B)
----.pyup.yml(82B)