You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a dependency on sqlalchemy[asyncio]>=2.0.0: one of our packages declares fastapi-users[sqlalchemy]>=13.0.0,<14, which pulls fastapi-users-db-sqlalchemy 7.0.0, which hard-requires sqlalchemy[asyncio]>=2.0.0,<2.1.0. Auth/OAuth machinery mandates SQLAlchemy 2.x.
Downgrading the package to SQLAlchemy 1.x would require also downgrading fastapi-users to ~10.x/11.x — a multi-major-version backstep of the auth library, with API changes around password hashing (pwdlib) and strategy interfaces.
(Claude reassures me that) SQLAlchemy 1.4 → 2.0 is mostly mechanical for declarative-base usage like liminal's
Would it be possible to upgrade sqlalchemy to support SQLAlchemy 2.x?
Hi Nirmit! I saw you mentioned this is blocked because Dyno is still on SQLAlchemy 1.x. I looked into whether liminal could support both 1.4 and 2.0, so nobody is forced to upgrade, and it turned out to be a small change:
widen the pin to sqlalchemy>=1.4.53,<2.1 (1.4 stays the locked dev version)
import declarative_base from sqlalchemy.orm instead of the deprecated ext.declarative path
set __allow_unmapped__ = True on Base, so existing models written as col: SqlColumn = Column(...) (including generated model files) keep working on 2.0 without regeneration
annotate the creator_id / creator declared_attrs with Mapped[...], which 2.0 requires
add a CI step that also runs the test suite on SQLAlchemy 2.0
Locally, all 19 tests pass on Python 3.10, 3.12 and 3.13 with both SQLAlchemy 1.4.53 and 2.0.57 (on 2.0 with SQLAlchemy deprecation warnings turned into errors), and pre-commit run -a passes.
Would you be open to a PR for this? Happy to adjust the approach if you'd prefer something different.
Full disclosure: I used an AI coding assistant to help with this, and I've reviewed and tested every change myself. Sorry if this is an unwelcome interruption. I'm just trying to use AI to make things a little easier for people, and hopefully earn a bit of extra money for my family along the way. This contribution is completely free, no strings attached.
We at Dyno are now starting to consider prioritizing a sql alchemy 2 upgrade, so I would say this is back on the table. If anything, this upgrading Liminal to sqlalchemy 2 would just be more incentive for us to make the push.
Thanks @steve-dyno, that's great to hear! I've opened #284 with the change described above. It keeps 1.4 working, so you can merge it and still upgrade Dyno on your own schedule. Happy to adjust anything, and no rush at all.
Activity
VickyTwig commentedon Apr 29, 2026
PS we've found a way around this so it's more of a nice to have for the future so low priority :)
nirmit-damania-dyno commentedon May 4, 2026
Hey Vicky!
This is definitely on my radar, but currently blocked by my company (Dyno Tx) still being on SQLAlchemy 1.
I'm curious to learn about your work around, to share knowledge in case others are facing a similar issue!
xravitycapital commentedon Nov 11, 2026
Hi Nirmit! I saw you mentioned this is blocked because Dyno is still on SQLAlchemy 1.x. I looked into whether liminal could support both 1.4 and 2.0, so nobody is forced to upgrade, and it turned out to be a small change:
sqlalchemy>=1.4.53,<2.1(1.4 stays the locked dev version)declarative_basefromsqlalchemy.orminstead of the deprecatedext.declarativepath__allow_unmapped__ = TrueonBase, so existing models written ascol: SqlColumn = Column(...)(including generated model files) keep working on 2.0 without regenerationcreator_id/creatordeclared_attrs withMapped[...], which 2.0 requiresLocally, all 19 tests pass on Python 3.10, 3.12 and 3.13 with both SQLAlchemy 1.4.53 and 2.0.57 (on 2.0 with SQLAlchemy deprecation warnings turned into errors), and
pre-commit run -apasses.Would you be open to a PR for this? Happy to adjust the approach if you'd prefer something different.
Full disclosure: I used an AI coding assistant to help with this, and I've reviewed and tested every change myself. Sorry if this is an unwelcome interruption. I'm just trying to use AI to make things a little easier for people, and hopefully earn a bit of extra money for my family along the way. This contribution is completely free, no strings attached.
steve-dyno commentedon Nov 11, 2026
We at Dyno are now starting to consider prioritizing a sql alchemy 2 upgrade, so I would say this is back on the table. If anything, this upgrading Liminal to sqlalchemy 2 would just be more incentive for us to make the push.
xravitycapital commentedon Nov 11, 2026
Thanks @steve-dyno, that's great to hear! I've opened #284 with the change described above. It keeps 1.4 working, so you can merge it and still upgrade Dyno on your own schedule. Happy to adjust anything, and no rush at all.