Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/psqlpy-python/psqlpy
Asynchronous Python PostgreSQL driver written in Rust
https://github.com/psqlpy-python/psqlpy
asyncio asyncpg-like database-driver high-performance postgresql postgresql-database postgresql-driver psycopg-like python-driver python-postgresql python3 rust
Last synced: about 1 month ago
JSON representation
Asynchronous Python PostgreSQL driver written in Rust
- Host: GitHub
- URL: https://github.com/psqlpy-python/psqlpy
- Owner: psqlpy-python
- License: mit
- Created: 2024-01-31T20:24:36.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-10-06T20:39:13.000Z (about 1 month ago)
- Last Synced: 2024-10-13T16:20:02.634Z (about 1 month ago)
- Topics: asyncio, asyncpg-like, database-driver, high-performance, postgresql, postgresql-database, postgresql-driver, psycopg-like, python-driver, python-postgresql, python3, rust
- Language: Rust
- Homepage: https://psqlpy-python.github.io/
- Size: 9.9 MB
- Stars: 218
- Watchers: 3
- Forks: 3
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/psqlpy?style=for-the-badge)](https://pypi.org/project/psqlpy/)
[![PyPI](https://img.shields.io/pypi/v/psqlpy?style=for-the-badge)](https://pypi.org/project/psqlpy/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/psqlpy?style=for-the-badge)](https://pypistats.org/packages/psqlpy)# 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](https://psqlpy-python.github.io/)## Installation
You can install package with `pip` or `poetry`.
poetry:
```bash
> poetry add psqlpy
```pip:
```bash
> pip install psqlpy
```Or you can build it by yourself. To do it, install stable rust and [maturin](https://github.com/PyO3/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.```python
from typing import Anyfrom 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,
)res: QueryResult = await db_pool.execute(
"SELECT * FROM users",
)print(res.result())
db_pool.close()```
## Benchmarks
You can find benchmarks with visualization on our [docs](https://psqlpy-python.github.io/benchmarks.html)
## Community
Let's make `PSQLPy` better together!
Join our community in [Telegram](https://t.me/+f3Y8mYKgXxhmYThi)