8000
Skip to content

column ordering hint for mapped_column #9297

Description

@zzzeek

noted in #9294 and now in the whats new notes in 037884e , we can add a new indicator to mapped_column() specifically that tells Declarative how to order columns when creating Table.

Why mapped_column()? Because this is ORM specific. Column / Table has no "sorting", the order is the order in which Column objects are placed into the Table.

Propose mapped_column.sort_order, which accepts any object type and uses it to apply sorted(). Users can specify integers, strings, floats, or any custom Python object that has an __lt__() method, so that any scheme can be created. which is an int value. By default all columns have the value of 0

Declarative would record this sort order and apply it specifically within the _setup_table() method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    declarativehas to do with the declarative API, scanning classes and mixins for attributes to be mappedormschemathings related to the DDL related objects like Table, Column, CreateIndex, etc.use casenot really a feature or a bug; can be support for new DB features or user use cases not anticipated

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    0