Takashi Kajinami d683ddb86e db: Don't rely on branched connections
We were previously calling 'connect()' on the 'connectable' object in
'run_migrations_online', regardless of whether it was an 'Engine' or
'Connection' object. This worked because, as noted in an inline comment,
"when connectable is already a Connection object, calling 'connect()'
gives us a *branched connection*." This is no longer the case. From the
SQLAlchemy docs [1]:

  The Connection object does not support "branching", which was a
  pattern by which a sub "connection" would be used that refers to this
  connection as a parent.

Update our code to reflect this change, using the newly updated example
from the SQLAlchemy cookbook doc [2] as inspiration.

[1] https://docs.sqlalchemy.org/en/14/core/future.html#sqlalchemy.future.Connection
[2] https://alembic.sqlalchemy.org/en/latest/cookbook.html#connection-sharing

Closes-Bug: #2061375
Co-Authored-By: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I5617dc7e6e97e4ba5aad2f5d8be40b2241b9cf4c
2024-04-15 09:52:30 +00:00
backends db: Don't rely on branched connections 2024-04-15 09:52:30 +00:00
__init__.py Removed copyright from empty files 2014-02-22 17:16:29 +08:00
base.py Replace abc.abstractproperty with property and abc.abstractmethod 2022-08-03 20:37:13 +08:00
models.py Remove six 2022-05-18 16:12:37 +09:00
path_based.py Remove six 2022-05-18 16:12:37 +09:00