Skip to main content

PostgreSQL client for Trio based on asyncpg

Project description

Automated test status (Linux and MacOS) Automated test status (Windows) Test coverage

triopg

Welcome to triopg!

PostgreSQL client for Trio based on asyncpg

License: Your choice of MIT or Apache License 2.0

Quick example:

import trio_asyncio
import triopg


async def main():
    conn = await triopg.connect()

    await conn.execute(
        """
        DROP TABLE IF EXISTS users;
        CREATE TABLE IF NOT EXISTS users (
            _id SERIAL PRIMARY KEY,
            user_id VARCHAR(32) UNIQUE
        )"""
    )

    async with conn.transaction():
        await conn.execute("INSERT INTO users (user_id) VALUES (1)")
        await conn.execute("INSERT INTO users (user_id) VALUES (2)")
        await conn.execute("INSERT INTO users (user_id) VALUES (3)")

    print(await conn.execute("SELECT * FROM users"))


trio_asyncio.run(main)

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

triopg-0.2.1.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

triopg-0.2.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file triopg-0.2.1.tar.gz.

File metadata

  • Download URL: triopg-0.2.1.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.1

File hashes

Hashes for triopg-0.2.1.tar.gz
Algorithm Hash digest
SHA256 acd5ca566b027c9e6f87dd8c574a183c6d0094f6336b7bf8307b9af4a637a26c
MD5 cd23a27df53fcbae14760b1c4c0d5137
BLAKE2b-256 dd402b7fb67a1c480687fdcbadb070547c94b5883044f1c520591a1cfb44dfc9

See more details on using hashes here.

File details

Details for the file triopg-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: triopg-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.1

File hashes

Hashes for triopg-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4eedd9ad5a6bc22531646853b12a196f5a4c59fdbc560ef665bb606e43542403
MD5 af64089710f811913c268d47c10e10a7
BLAKE2b-256 7b049a1c161cd1f7705ba9ed6118a3408955961b179074e5cc7ca05d4c701140

See more details on using hashes here.

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