PostgreSQL client for Trio based on asyncpg
Project description
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)
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | acd5ca566b027c9e6f87dd8c574a183c6d0094f6336b7bf8307b9af4a637a26c |
|
MD5 | cd23a27df53fcbae14760b1c4c0d5137 |
|
BLAKE2b-256 | dd402b7fb67a1c480687fdcbadb070547c94b5883044f1c520591a1cfb44dfc9 |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4eedd9ad5a6bc22531646853b12a196f5a4c59fdbc560ef665bb606e43542403 |
|
MD5 | af64089710f811913c268d47c10e10a7 |
|
BLAKE2b-256 | 7b049a1c161cd1f7705ba9ed6118a3408955961b179074e5cc7ca05d4c701140 |