kvesteri / postgresql-audit

Audit trigger for PostgreSQL
BSD 2-Clause "Simplified" License
126 stars 28 forks source link

[Chore] Remove SQLA 2.0 deprecations #76

Closed tchapi closed 1 year ago

tchapi commented 1 year ago

Hi 👋🏼

Following https://github.com/kvesteri/postgresql-audit/issues/62, this is a first pass at removing SQLAlchemy 2.0 deprecations as indicated in the documentation.

Known remaining deprecated parts:

Note: This is fully 1.4-compatible AFAIK Note²: Running the tests with SQLALCHEMY_WARN_20=1 tox helps finding the offending deprecations

tchapi commented 1 year ago

Great! Thank you for the merge. Any idea on this bind.execute(self.stmt) by any chance?

jpvanhal commented 1 year ago

I think the issue is that StatementExecutor is attempting to create a sub-transaction with tx = bind.begin(). My hunch is that we can remove it since there's already an ongoing transaction.

tchapi commented 1 year ago

My hunch is that we can remove it since there's already an ongoing transaction.

Will try that, thanks for the pointer