AsyncPG Easy-To-Use wrapper
Project description
AsyncPG Wrapper
Легкая в обращении обёртка над AsyncPG
версия 0.1.2
Wrapper принимает и возращает только объекты типа dict() и List[dict]
Установка
pip install asyncpg-wrapper
Инициализация в коде
from asyncpg_wrapper import AsyncDB
dsn = "postgresql://username:password@host:port/dbname"
db = AsyncDB(dsn)
Примеры операций:
new_record = await db.insert('users', {'first_name': 'John', 'last_name': 'Doe'})
print(new_record)
l = [{'first_name': f'John{i}', 'last_name': f'Doe{i}'} for i in range(0, 1000)]
new_records = await db.insertmany('users', l)
print(new_records)
updated_record = await db.update('users', "id=1", {'first_name': 'Jane'})
print(updated_record)
deleted_records = await db.delete('users', "first_name='Jane'")
print(deleted_records)
deleted_records = await db.delete('users')
print(deleted_records)
selected_records = await db.select('users', 'id=1')
print(selected_records)
selected_records = await db.select('users')
print(selected_records)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
asyncpg_wrapper-0.1.2.tar.gz
(3.0 kB
view details)
Built Distribution
File details
Details for the file asyncpg_wrapper-0.1.2.tar.gz
.
File metadata
- Download URL: asyncpg_wrapper-0.1.2.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3be8dcac26c518d5ffc414937cf32a984e79dce61d8f54a24bd7f49851f8e124 |
|
MD5 | 74d1b8ead28ad6a88e8b30dd19ac5633 |
|
BLAKE2b-256 | 3c914ca9989c0d45eda279ad413c63431baeea1dc36b3742496e5a0977f36e0b |
File details
Details for the file asyncpg_wrapper-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: asyncpg_wrapper-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3535cf6aec6d57fb245b9d2c9f5a3de7c4c3180eb268d9ebfaee65976a03b06b |
|
MD5 | ab41d1761b435a5a258dd2011bca372c |
|
BLAKE2b-256 | 034f8028255fdc28e3b19ea40fba962babbe7b133ba5f291b155a78666cb9e5d |