class documentation

Defines an identity column, i.e. "GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY" syntax. The :class:`.Identity` construct is an inline construct added to the argument list of a :class:`_schema.Column` object:: from sqlalchemy import Identity Table('foo', metadata_obj, Column('id', Integer, Identity()) Column('description', Text), ) See the linked documentation below for complete details. .. versionadded:: 1.4 .. seealso:: :ref:`identity_ddl`

Method __init__ Construct a GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY DDL construct to accompany a :class:`_schema.Column`.
Method copy Undocumented
Class Variable __visit_name__ Undocumented
Instance Variable always Undocumented
Instance Variable column Undocumented
Instance Variable on_null Undocumented
Method _as_for_update Undocumented
Method _copy Undocumented
Method _set_parent Associate with this SchemaEvent's parent object.

Inherited from IdentityOptions:

Instance Variable cache Undocumented
Instance Variable cycle Undocumented
Instance Variable increment Undocumented
Instance Variable maxvalue Undocumented
Instance Variable minvalue Undocumented
Instance Variable nomaxvalue Undocumented
Instance Variable nominvalue Undocumented
Instance Variable order Undocumented
Instance Variable start Undocumented

Inherited from FetchedValue (via IdentityOptions):

Method __repr__ Undocumented
Class Variable has_argument Undocumented
Class Variable is_clause_element Undocumented
Class Variable is_server_default Undocumented
Class Variable reflected Undocumented
Instance Variable for_update Undocumented
Method _clone Undocumented

Inherited from SchemaItem (via IdentityOptions, FetchedValue):

Class Variable create_drop_stringify_dialect Undocumented
Property info Info dictionary associated with the object, allowing user-defined data to be associated with this :class:`.SchemaItem`.
Method _init_items Initialize the list of child items for this SchemaItem.
Method _schema_item_copy Undocumented
Class Variable _use_schema_map Undocumented

Inherited from SchemaEventTarget (via IdentityOptions, FetchedValue, SchemaItem):

Class Variable dispatch Undocumented
Method _set_parent_with_dispatch Undocumented

Inherited from EventTarget (via IdentityOptions, FetchedValue, SchemaItem, SchemaEventTarget):

Class Variable __slots__ Undocumented

Inherited from Visitable (via IdentityOptions, FetchedValue, SchemaItem, SchemaEventTarget, EventTarget):

Method __class_getitem__ Undocumented
Method __init_subclass__ Undocumented
Class Method _generate_compiler_dispatch Undocumented
Method _compiler_dispatch Undocumented
Class Variable _original_compiler_dispatch Undocumented
def __init__(self, always: bool = False, on_null: Optional[bool] = None, start: Optional[int] = None, increment: Optional[int] = None, minvalue: Optional[int] = None, maxvalue: Optional[int] = None, nominvalue: Optional[bool] = None, nomaxvalue: Optional[bool] = None, cycle: Optional[bool] = None, cache: Optional[int] = None, order: Optional[bool] = None): (source)

Construct a GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY DDL construct to accompany a :class:`_schema.Column`. See the :class:`.Sequence` documentation for a complete description of most parameters. .. note:: MSSQL supports this construct as the preferred alternative to generate an IDENTITY on a column, but it uses non standard syntax that only support :paramref:`_schema.Identity.start` and :paramref:`_schema.Identity.increment`. All other parameters are ignored. :param always: A boolean, that indicates the type of identity column. If ``False`` is specified, the default, then the user-specified value takes precedence. If ``True`` is specified, a user-specified value is not accepted ( on some backends, like PostgreSQL, OVERRIDING SYSTEM VALUE, or similar, may be specified in an INSERT to override the sequence value). Some backends also have a default value for this parameter, ``None`` can be used to omit rendering this part in the DDL. It will be treated as ``False`` if a backend does not have a default value. :param on_null: Set to ``True`` to specify ON NULL in conjunction with a ``always=False`` identity column. This option is only supported on some backends, like Oracle. :param start: the starting index of the sequence. :param increment: the increment value of the sequence. :param minvalue: the minimum value of the sequence. :param maxvalue: the maximum value of the sequence. :param nominvalue: no minimum value of the sequence. :param nomaxvalue: no maximum value of the sequence. :param cycle: allows the sequence to wrap around when the maxvalue or minvalue has been reached. :param cache: optional integer value; number of future values in the sequence which are calculated in advance. :param order: optional boolean value; if true, renders the ORDER keyword.

@util.deprecated('1.4', 'The :meth:`_schema.Identity.copy` method is deprecated and will be removed in a future release.')
def copy(self, **kw: Any) -> Identity: (source)

Undocumented

Undocumented

Undocumented

def _as_for_update(self, for_update: bool) -> FetchedValue: (source)
def _copy(self, **kw: Any) -> Identity: (source)
def _set_parent(self, parent: SchemaEventTarget, **kw: Any): (source)

Associate with this SchemaEvent's parent object.