You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(sqlalchemy): adopt SA dialect+driver URL convention
Switch the wrapper's SQLAlchemy dialect registration from a parallel
top-level dialect name (aws_wrapper_postgresql+psycopg, aws_wrapper_mysql+
mysqlconnector, ...) to SA's idiomatic <dialect>+<driver> form, so the
wrapper plugs in as a driver under the stock postgresql/mysql dialects.
This matches the AWS-approved ORM PR aws#1224 convention and removes the
two-conventions-for-one-wrapper inconsistency the merge would otherwise
leave. Done now because the branch is unreleased -- no public URL is broken.
Entry points (3, was 8):
- postgresql.aws_wrapper_psycopg -> sync AND async
- mysql.aws_wrapper_mysqlconnector -> sync
- mysql.aws_wrapper_aiomysql -> async
PostgreSQL serves both sync and async from ONE URL
(postgresql+aws_wrapper_psycopg://): psycopg3 is a single DBAPI that does
both, so AwsWrapperPGPsycopgDialect implements get_async_dialect_cls to
return the async dialect. create_async_engine drives
URL.get_dialect(_is_async=True) -> that hook (verified against SA 2.0.49);
create_engine uses the sync class. Mirrors stock postgresql+psycopg.
MySQL needs two driver names because its sync (mysql-connector-python) and
async (aiomysql) paths are different DBAPIs that cannot share a URL. The
async name drops the redundant _async suffix (aiomysql is async-only),
mirroring stock mysql+aiomysql.
Dialect classes: driver attrs updated (aws_wrapper_psycopg /
aws_wrapper_mysqlconnector / aws_wrapper_aiomysql); PG async keeps the
sync driver name since it is reached via the hook, not a distinct URL.
Updated: unit tests (test_sqlalchemy_dialects, test_aio_sqlalchemy_dialect,
test_aio_aiomysql) -- the async-PG registry-key tests become
get_async_dialect_cls resolution tests; integration helpers + test URLs;
SqlAlchemySupport.md (rewrote the Naming section), IntegrationTests.md,
the *AsyncFailover examples, and dialect/submodule docstrings.
Note: editable installs must `poetry install` to refresh
entry_points.txt after this change (stale metadata otherwise resolves the
old names).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/development-guide/IntegrationTests.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,7 @@ unset FILTER # Done testing the IAM tests, unset FILTER
66
66
67
67
## Running async integration tests
68
68
69
-
The wrapper ships async counterparts to every sync integration test file. Async tests exercise `AsyncAwsWrapperConnection` (raw) and `create_async_engine` with the wrapper's async dialects (`aws_wrapper_postgresql+psycopg_async`, `aws_wrapper_mysql+aiomysql_async`). They are invoked via dedicated Gradle tasks, independent of the sync tasks:
69
+
The wrapper ships async counterparts to every sync integration test file. Async tests exercise `AsyncAwsWrapperConnection` (raw) and `create_async_engine` with the wrapper's dialects (`postgresql+aws_wrapper_psycopg` — shared with sync via `get_async_dialect_cls`; `mysql+aws_wrapper_aiomysql`). They are invoked via dedicated Gradle tasks, independent of the sync tasks:
0 commit comments