litestar-org/polyfactory

Enhancement: Support SQLA v1

adhtruong opened this issue · 9 comments

Summary

  • SQLA model support for was added in #369
  • This only covered latest major release
  • Places that need changing
    • Factory typing itself as orm.DeclarativeBase is in 2 only
    • Related tests to avoid using things like orm.mapped_column
    • Pipeline to install SQLA1.4.

Basic Example

No response

Drawbacks and Impact

No response

Unresolved questions

No response


Funding

  • If you would like to see an issue prioritized, make a pledge towards it!
  • We receive the pledge once the issue is completed & verified
Fund with Polar

Any update on where this is at? We're unable to upgrade to SQLAlchemy 2 atm so would be great if 1.4 was supported

guacs commented

Any update on where this is at? We're unable to upgrade to SQLAlchemy 2 atm so would be great if 1.4 was supported

This isn't being actively worked on currently, but it's definitely on the roadmap. On that note, if you'd like to help with that, PRs would be greatly appreciated :)

I'm looking at this one. I initially tried supporting it in the original PR but wanted to split it out for reviewability reasons.

I've got a draft PR in now and hopefully clean up for review in the next few days.

guacs commented

Reopening this to see if we can expand the support for SQLA v1.

I think technically should be feasible with constructs in 1.3/1.4 being similar. I can't find officially supported versions but https://docs.sqlalchemy.org/en/20/changelog/changelog_13.html#change-1.3.24 implies that 1.3 is no longer supported.

guacs commented

I think technically should be feasible with constructs in 1.3/1.4 being similar. I can't find officially supported versions but https://docs.sqlalchemy.org/en/20/changelog/changelog_13.html#change-1.3.24 implies that 1.3 is no longer supported.

Oh, I see. Then let's see if we can support 1.4.*. If it doesn't seem like it's worth the trouble, then we can just go ahead with your original solution of pinning the minimum requirement to be 1.4.49.

I checked on my local and https://www.sqlalchemy.org/blog/2021/12/23/sqlalchemy-1.4.29-released/ seems to work. I added this as a lower bound in the pipeline PR so this is documented. This is a reasonable range to support without trying to target very old versions

guacs commented

I checked on my local and https://www.sqlalchemy.org/blog/2021/12/23/sqlalchemy-1.4.29-released/ seems to work. I added this as a lower bound in the pipeline PR so this is documented. This is a reasonable range to support without trying to target very old versions

Sounds good to me. Could you add that and create a PR?

I added this bound in #389.