-
Notifications
You must be signed in to change notification settings - Fork 107
Closed
Description
Summary
PyAthena now has native asyncio cursor implementations (pyathena/aio/) added in PRs #666, #667, #668, but the SQLAlchemy dialects (pyathena/sqlalchemy/) remain synchronous only. Adding async SQLAlchemy dialects would allow PyAthena to be used with async ORMs and frameworks that rely on SQLAlchemy's async engine (e.g., FastAPI + SQLAlchemy async session).
Background
SQLAlchemy 2.0+ supports async dialects via AdaptedConnection and AsyncDialect / create_async_engine. The existing synchronous dialects are:
| Dialect | Connection string | Cursor |
|---|---|---|
AthenaRestDialect |
awsathena+rest:// |
Cursor |
AthenaPandasDialect |
awsathena+pandas:// |
PandasCursor |
AthenaArrowDialect |
awsathena+arrow:// |
ArrowCursor |
AthenaPolarsDialect |
awsathena+polars:// |
PolarsCursor |
AthenaS3FSDialect |
awsathena+s3fs:// |
S3FSCursor |
Each of these could have an async counterpart using the corresponding Aio*Cursor.
Scope
- Implement async SQLAlchemy dialect(s) using
AioConnectionand native asyncio cursors - Connection string convention (e.g.,
awsathena+aiorest://or similar) - Register as SQLAlchemy entry points in
pyproject.toml - Add documentation to
docs/sqlalchemy.md
Related
- Comprehensive cursor benchmark with memory and performance metrics #644 — Native asyncio implementation tracking issue
- Add native asyncio cursor support (AioCursor) #662 — Native asyncio implementation plan
- PRs Add native asyncio cursor support (Phase 1) #666, Add native asyncio specialized cursors and DRY refactors (Phase 2) #667, Add native asyncio S3FS and Spark cursors with boilerplate deduplication (Phase 3) #668 — Native asyncio cursor implementations
- PR Add documentation for native asyncio cursors #671 — Documentation for aio cursors
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels