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

Uploaded Source

Built Distribution

triopg-0.3.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: triopg-0.3.0.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.3.0.tar.gz
Algorithm Hash digest
SHA256 2620c4f5b9e9ef5fe674d712808dcc1f95c1ab772be589ac199c3f7f3e7d3aac
MD5 cde01b3483dce757ef414bad3546c58e
BLAKE2b-256 249abb80f14b5f14471a580de927f176f8955adde7af65517b637f369ee8be97

See more details on using hashes here.

File details

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

File metadata

  • Download URL: triopg-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa6e5cb4deb23e52a2a433fae706930d328101279b7d6f9fa8ad7fc4491dfe3f
MD5 4d84650094fdfafa4075b48a136abc1c
BLAKE2b-256 8e2ae0f946ae761dc42e0f861677116ad950150f18ec7526e4c8507aa3def125

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