Skip to content

Add docs for SQL Alchemy ORM support#1237

Open
jonathanl-bq wants to merge 82 commits into
mainfrom
sql-alchemy-orm-docs
Open

Add docs for SQL Alchemy ORM support#1237
jonathanl-bq wants to merge 82 commits into
mainfrom
sql-alchemy-orm-docs

Conversation

@jonathanl-bq
Copy link
Copy Markdown
Contributor

Description

This PR adds documentation for SQL Alchemy ORM support.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jonathanl-bq jonathanl-bq marked this pull request as ready for review May 22, 2026 23:08

| Driver | Database Dialect |
|-------------------|------------------|
| `aws_wrapper_mysqlconnector` | `mysql` |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious on this "database dialect" - is that from our wrapper or sql alchemy? if it's our wrapper should we not support aurora-mysql and the other mysql database dialects too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied this table from the other documentation and adapted it to fit the URL information defined in pyproject.toml:

[tool.poetry.plugins."sqlalchemy.dialects"]
"mysql.aws_wrapper_mysqlconnector" = "aws_advanced_python_wrapper.sqlalchemy.mysql_orm_dialect:SqlAlchemyOrmMysqlDialect"

This is supposed to help the user figure out what the put in their create_engine URL:

create_engine("**mysql+aws_wrapper_mysqlconnector**://your_username:your_password@your-cluster-endpoint.cluster-xyz.us-east-1.rds.amazonaws.com:your_port/your_database_name?connect_timeout=10&wrapper_plugins=aurora_connection_tracker%2Cfailover_v2")

I don't believe we need to explicitly add the aurora-mysql and other mysql database dialects here, but I'm also not 100% sure about this. Maybe worth asking @faviansamatha about this?


The Read/Write Splitting Plugin is not supported for SQLAlchemy, since session binds already implement this functionality.

See the [official SQLAlchemy documentation on the Session API](https://docs.sqlalchemy.org/en/20/orm/session_api.html) for more information on session binds.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love to see this maybe structured a different way or with some additional plugins that ARE supported. You say that there are many other plugins and then only list one so I would suggest either

  1. add to line 34 that failover is the most relevant and then keep the section as is
  2. list iam as another plugin that is helpful after failover

I would also like rw splitting to be under a header of something like "not supported" It's confusing that it is positioned the same way as failover which is supported. Adding a not supported section would also give you space to mention that lack of pg support again

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could consider reworking this into a plugin compatibility section, and create a table indicating which plugins are supported and which are not (rw splitting and srw)

Comment thread docs/using-the-python-wrapper/SqlAlchemySupport.md

### Failover Plugin

The Failover Plugin provides automatic failover handling for Aurora clusters. When a database instance becomes unavailable, the plugin automatically connects to a healthy instance in the cluster.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a link to the failover plugin docs here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was already there, but I decided to move it up to make it more visible. I also updated it to point to the v2 docs instead of v1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants