Skip to main content

Asyncio psycopg2 mixin

Project description

psycaio

A Python asyncio wrapper around psycopg2

Example

import asyncio

from psycaio import connect


async def test_conn():
    cn = await connect(dbname='postgres')
    cr = cn.cursor()
    await cr.execute("SELECT 42")
    print(cr.fetchone()[0])
    cr = cn.cursor()
    await cr.execute("SELECT 42")
    print(cr.fetchone()[0])


if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    loop.run_until_complete(test_conn())
    loop.close()

About

This package is meant as a minimal asyncio mixin for psycopg2.

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

psycaio-0.3.tar.gz (13.1 kB view hashes)

Uploaded Source

Built Distribution

psycaio-0.3-py3-none-any.whl (11.8 kB view hashes)

Uploaded Python 3

Supported by

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