Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to SQLAlchemy 2 style #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

acarapetis
Copy link
Contributor

tests/test_pg.py::test_errors_and_messages is failing for me, but it does so even with sqlbag@master and sqlalchemy 1.3, so not sure what's up there - perhaps a pg or psycopg2 config issue. All other tests are now passing with sqlalchemy 1.3 and 2.0.

- Replace Engine.execute with Connection.execute
- Ensure all raw SQL strings are wrapped in sqlalchemy.text
- Use explicit bound parameter dicts (see
  https://docs.sqlalchemy.org/en/20/changelog/migration_20.html#execute-method-more-strict-execution-options-are-more-prominent)
SQLAlchemy 2 added row.t as a synonym for row.tuple(), which broke this
test. I've renamed the column t to ti to fix this.
@rishabh-cldcvr
Copy link

Can we get this merged?

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.

2 participants