Fixed compatibility with SQLAlchemy >= 2.0 #250

Merged
blacklight merged 9 commits from 239-sqlalchemy-2-compatibility into master 2023-04-25 10:47:28 +02:00

9 Commits

Author SHA1 Message Date
Fabio Manganiello 9c93b793e3
Merge branch 'master' into 239-sqlalchemy-2-compatibility 2023-04-25 10:44:31 +02:00
Fabio Manganiello dd60b8924d
Wrap the `PRAGMA` statement in `sqlalchemy.text`.
SQLAlchemy 2 no longer supports raw strings passed to `.execute()`
methods.
2023-04-25 10:41:37 +02:00
Fabio Manganiello 440d70d9cf
LINT/format fixes. 2023-04-25 10:36:27 +02:00
Fabio Manganiello 4cc88fcf5f
Rewritten the `variable` plugin to use SQLAlchemy's ORM.
This removes the need for raw SQL statements and CREATE TABLE statements
that may be engine-specific.
2023-04-25 10:35:12 +02:00
Fabio Manganiello e1cd22121a
Removed `connection.begin()` pattern from the `db` plugin.
SQLAlchemy should automatically begin a transaction on
connection/session creation. Plus, `.begin()` messes up things with
SQLAlchemy 2, which has `autobegin` enabled with no easy way of
disabling it.
2023-04-25 10:31:49 +02:00
Fabio Manganiello 37722d12cd
No need for `session.begin` in `db.create_all`. 2023-04-24 23:55:50 +02:00
Fabio Manganiello 6fa179e769
LINT fixes 2023-04-24 23:49:31 +02:00
Fabio Manganiello 91df18f7b5
Better way to import `declarative_base` from SQLAlchemy.
Import `declarative_base` in a way that is compatible with any
SQLAlchemy version between 1.3 and 2.x.
2023-04-24 23:21:39 +02:00
Fabio Manganiello 87889142e0
Fixed compatibility with SQLAlchemy >= 2.0 in the `db` plugin. 2023-04-24 22:52:17 +02:00