]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commit
fix(typings): improve typing for server_default
authorSebastian Kreft <911768+sk-@users.noreply.github.com>
Sun, 18 Jan 2026 15:26:05 +0000 (10:26 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 27 Jan 2026 18:43:15 +0000 (13:43 -0500)
commit91a51160fbcb80c92cd4ff4d3ce892588131c773
tree4b8930f437a9bce46b7cfb894991b07e3e70fdee
parentb36174eaa7f8723e5f9f579282147263e8c96241
fix(typings): improve typing for server_default

Fixed typing issue where the :paramref:`.AlterColumnOp.server_default` and
:paramref:`.AlterColumnOp.existing_server_default` parameters failed to
accommodate common SQLAlchemy SQL constructs such as ``null()`` and
``text()``.   Pull request courtesy Sebastian Kreft.

this sets up a standard type for the server default argument using
an alias, and adds modifications to write_pyi for extremely basic
ability to render type aliases (with limitations).

Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Fixes: #1669
Closes: #1670
Pull-request: https://github.com/sqlalchemy/alembic/pull/1670
Pull-request-sha: e6464647b6e33e077e7baf4bbc5c7549ab570a06

Change-Id: Id25bf7fd706f91aa637adf9b67f0529f1d7d1080
12 files changed:
alembic/ddl/base.py
alembic/ddl/impl.py
alembic/ddl/mssql.py
alembic/ddl/mysql.py
alembic/ddl/postgresql.py
alembic/op.pyi
alembic/operations/base.py
alembic/operations/batch.py
alembic/operations/ops.py
alembic/operations/toimpl.py
docs/build/unreleased/1669.rst [new file with mode: 0644]
tools/write_pyi.py