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.3.0.tar.gz
(14.8 kB
view details)
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2620c4f5b9e9ef5fe674d712808dcc1f95c1ab772be589ac199c3f7f3e7d3aac |
|
MD5 | cde01b3483dce757ef414bad3546c58e |
|
BLAKE2b-256 | 249abb80f14b5f14471a580de927f176f8955adde7af65517b637f369ee8be97 |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa6e5cb4deb23e52a2a433fae706930d328101279b7d6f9fa8ad7fc4491dfe3f |
|
MD5 | 4d84650094fdfafa4075b48a136abc1c |
|
BLAKE2b-256 | 8e2ae0f946ae761dc42e0f861677116ad950150f18ec7526e4c8507aa3def125 |