项目
在 GitHub 查看
psqlpy-python/psqlpy
关于
Asynchronous Python PostgreSQL driver written in Rust
数据与分析实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文PSQLPy - Async PostgreSQL driver for Python written in Rust.
Driver for PostgreSQL written fully in Rust and exposed to Python. Main goals of the library is speed and type safety.
Documentation
You can find full documentation here - PSQLPy documentation
Installation
You can install package with pip, poetry or uv.
poetry:
poetry add psqlpy
pip:
pip install psqlpy
uv:
uv add psqlpy
Or you can build it by yourself. To do it, install stable rust and maturin.
maturin develop --release
Usage
Usage is as easy as possible. Create new instance of ConnectionPool and start querying. You don't need to startup connection pool, the connection pool will create connections as needed.
from psqlpy import ConnectionPool, QueryResult
async def main() -> None:
db_pool = ConnectionPool(
username="postgres",
password="pg_password",
host="localhost",
port=5432,
db_name="postgres",
max_db_pool_size=2,
)
async with db_pool.acquire() as conn:
res: QueryResult = await conn.execute(
"SELECT * FROM users",
)
print(res.result())
db_pool.close()
Benchmarks
You can find benchmarks with visualization on our docs
Community
Let's make PSQLPy better together!
Join our community in Telegram
探索相关项目
加载中…