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.0.tar.gz
(14.6 kB
view details)
Built Distribution
File details
Details for the file triopg-0.2.0.tar.gz
.
File metadata
- Download URL: triopg-0.2.0.tar.gz
- Upload date:
- Size: 14.6 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 | b01d180e96588badf2320ac71ac0319deb88cc40395be6dc3de7ba1ce39fce8a |
|
MD5 | 05a79096985b84d9edccb3775ec21407 |
|
BLAKE2b-256 | 0cb503a0b76c6c2cca21e6961b7ade1b81073a0c518f8b3084e02c8c35a97e25 |
File details
Details for the file triopg-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: triopg-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.9 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 | 22a6eebcf254b0cf92c403ab3c7b13fae9e81b49b1d621393276392c2452b4c7 |
|
MD5 | 7e76c27de0ac8492080020283967ff51 |
|
BLAKE2b-256 | 2a94455f06706be5f17b1f6f67a46d8ec44b86d010f16dde74fbc5c2d20e252a |