sqlbag icon indicating copy to clipboard operation
sqlbag copied to clipboard

Update to SQLAlchemy 2 style

Open acarapetis opened this issue 2 years ago • 1 comments

  • 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)

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.

acarapetis avatar Mar 19 '23 06:03 acarapetis

Can we get this merged?

rishabh-cldcvr avatar Dec 16 '24 19:12 rishabh-cldcvr