github agronholm/sqlacodegen 5.0.0

one hour ago
  • Dropped support for Python 3.10 and added support for Python 3.15 (PR by @sheinbergon )
  • Printed informational dependency messages to stderr instead of stdout to prevent corrupting generated model code when stdout is redirected (#451; PR by @Rajan-vish)
  • BACKWARD INCOMPATIBLE The SQLModel generator no longer emits t_<tablename> Table variables for many-to-many association tables that have a primary key, and their relationships no longer pass secondary via sa_relationship_kwargs. Code importing those variables will break when models are regenerated. Use the nolinktables option to keep the previous output.
  • Added SQLAlchemy 2.1 support (#489; PR by @Claire-ovo, reworked by @sheinbergon)
  • Added support for many-to-many link models in the SQLModel generator: association tables with a primary key are now rendered as SQLModel classes and referenced via Relationship(link_model=...) (#405; PR by @sheinbergon)
  • Fixed remote_side in a self-referential relationship pointing at the primary key when the foreign key targets other columns (such as a UNIQUE constraint), which made mapper configuration fail with ArgumentError (#484; PR by @NixBiks)
  • Fixed a column named registry being rendered as-is, which made SQLAlchemy warn that the attribute should be left reserved for the declarative class registry; it is now renamed to registry_ the same way a metadata column already was
  • Fixed many-to-many link tables leaking onto same-named tables in other schemas, which generated invalid relationships and made mapper configuration fail with NoForeignKeysError

Don't miss a new sqlacodegen release

NewReleases is sending notifications on new releases.