psqlpy
psqlpy copied to clipboard
Missing Support for SQLAlchemy Dialect in PSQLPy
trafficstars
Problem
Currently, PSQLPy lacks a dedicated SQLAlchemy dialect, making it impossible to use PSQLPy as a backend with SQLAlchemy for seamless database interactions. This is a significant limitation for users who rely on SQLAlchemy's ORM and query-building capabilities alongside PSQLPy's performance and type safety benefits.
Expected Behavior
A new SQLAlchemy dialect should be implemented to allow PSQLPy to work as a backend for SQLAlchemy, supporting asynchronous connections and utilizing PSQLPy's unique features such as:
- Native support for prepared statements.
- Efficient handling of PostgreSQL data types like
json,jsonb, andinterval. - Compatibility with
create_async_engineand SQLAlchemy's connection abstractions.
Example Usage
from sqlalchemy.ext.asyncio import create_async_engine
engine = create_async_engine(
"postgresql+psqlpy://user:password@host:port/database",
pool_size=10,
echo=True
)