Closed tdamsma closed 3 years ago
Let's defer this PR until #61 (and maybe #55) is/are merged.
FYI, @tdamsma
After doing some more tests regarding #57, I found a deficiency in the test suite. I added a comment to #57 describing the issue with the test case and offering an alternate test case that surfaces the regression.
@tdamsma Thank you for the contribution so far. We would like to proceed with the changes. I would prefer to move the list from the top to a separate issue. We can then merge this PR already, as it provides a valuable testing setup. This will allow us to cut release with SQLAlchemy 1.4 compatibility and go further with the drop of support for 0.9 and 1.0.
The coverage test fails because of current problems on the coveralls.io side.
See #64 as the followup for fixing the 2.0 deprecation warnings.
Preliminary support for sqlalchemy 1.4, at least the tests are passing to solve #60
Incorporates #61 and #59
I think the changes made in this PR are enough to make zope.sqlalchemy src compatible with sqlalchemy 2.0 There are however still a lot of warnings raised in the test code. To be fully compatible with 2.0, at least this list of warnings will need to be addressed:
MovedIn20Warning: The ``declarative_base()`` function is now available as sqlalchemy.orm.declarative_base()
RemovedIn20Warning: Passing a string to Connection.execute() is deprecated and will be removed in version 2.0. Use the text() construct, or the Connection.exec_driver_sql() method to invoke a driver-level SQL string
RemovedIn20Warning: The ``bind`` argument for schema methods that invoke SQL against an engine or connection will be required in SQLAlchemy 2.0
RemovedIn20Warning: The connection.execute() method in SQLAlchemy 2.0 will accept parameters as a single dictionary or a single sequence of dictionaries only. Parameters passed as keyword arguments, tuples or positionally oriened dictionaries and/or tuples will no longer be accepted.
RemovedIn20Warning: The FromClause.select().whereclause parameter is deprecated and will be removed in version 2.0. Please make use of the Select.where() method to add WHERE criteria to the SELECT statement
RemovedIn20Warning: The legacy calling style of select() is deprecated and will be removed in SQLAlchemy 2.0. Please use the new calling style described at select()
RemovedIn20Warning: The Query.get() method is considered legacy as of the 1.x series of SQLAlchemy and becomes a legacy construct in 2.0. The method is now available as Session.get()
RemovedIn20Warning: The relation construct is considered legacy as of the 1.x series of SQLAlchemy and will be removed in 2.0. Please use relationship()
RemovedIn20Warning: The Session.transaction attribute is considered legacy as of the 1.x series of SQLAlchemy and will be removed in 2.0. For context manager use, use Session.begin(). To access the current root transaction, use Session.get_transaction()
RemovedIn20Warning: The update.whereclause parameter will be removed in SQLAlchemy 2.0. Please refer to the Update.where() method.
RemovedIn20Warning: This Session located a target engine via bound metadata; as this functionality will be removed in SQLAlchemy 2.0, an Engine object should be passed to the Session() constructor directly