summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/_typing.py
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2023-02-16 21:52:18 +0100
committerMike Bayer <mike_mp@zzzcomputing.com>2023-02-16 19:21:43 -0500
commit361beb0bc8392c92403ffc1999eb2a9847e945c7 (patch)
tree3dae6d59043f033220eff0cf2d0526fe4984bc0e /lib/sqlalchemy/sql/_typing.py
parentfa1026cd7c24d4b6e1bc2dba6e0f3d83fb8cf064 (diff)
downloadsqlalchemy-361beb0bc8392c92403ffc1999eb2a9847e945c7.tar.gz
Allow custom sorting of column in the ORM.
To accommodate a change in column ordering used by ORM Declarative in SQLAlchemy 2.0, a new parameter :paramref:`_orm.mapped_column.sort_order` has been added that can be used to control the order of the columns defined in the table by the ORM, for common use cases such as mixins with primary key columns that should appear first in tables. The change notes at :ref:`change_9297` illustrate the default change in ordering behavior (which is part of all SQLAlchemy 2.0 releases) as well as use of the :paramref:`_orm.mapped_column.sort_order` to control column ordering when using mixins and multiple classes (new in 2.0.4). Fixes: #9297 Change-Id: Ic7163d64efdc0eccb53d6ae0dd89ec83427fb675
Diffstat (limited to 'lib/sqlalchemy/sql/_typing.py')
-rw-r--r--lib/sqlalchemy/sql/_typing.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/_typing.py b/lib/sqlalchemy/sql/_typing.py
index ab124103f..6bf9a5a1f 100644
--- a/lib/sqlalchemy/sql/_typing.py
+++ b/lib/sqlalchemy/sql/_typing.py
@@ -264,6 +264,8 @@ _EquivalentColumnMap = Dict["ColumnElement[Any]", Set["ColumnElement[Any]"]]
_LimitOffsetType = Union[int, _ColumnExpressionArgument[int], None]
+_AutoIncrementType = Union[bool, Literal["auto", "ignore_fk"]]
+
if TYPE_CHECKING:
def is_sql_compiler(c: Compiled) -> TypeGuard[SQLCompiler]: