class Identity(IdentityOptions, FetchedValue, SchemaItem): (source)
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 |
Undocumented |
Instance Variable | always |
Undocumented |
Instance Variable | column |
Undocumented |
Instance Variable | on |
Undocumented |
Method | _as |
Undocumented |
Method | _copy |
Undocumented |
Method | _set |
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 |
Undocumented |
Class Variable | is |
Undocumented |
Class Variable | is |
Undocumented |
Class Variable | reflected |
Undocumented |
Instance Variable | for |
Undocumented |
Method | _clone |
Undocumented |
Inherited from SchemaItem
(via IdentityOptions
, FetchedValue
):
Class Variable | create |
Undocumented |
Property | info |
Info dictionary associated with the object, allowing user-defined data to be associated with this :class:`.SchemaItem`. |
Method | _init |
Initialize the list of child items for this SchemaItem. |
Method | _schema |
Undocumented |
Class Variable | _use |
Undocumented |
Inherited from SchemaEventTarget
(via IdentityOptions
, FetchedValue
, SchemaItem
):
Class Variable | dispatch |
Undocumented |
Method | _set |
Undocumented |
Inherited from EventTarget
(via IdentityOptions
, FetchedValue
, SchemaItem
, SchemaEventTarget
):
Class Variable | __slots__ |
Undocumented |
Inherited from Visitable
(via IdentityOptions
, FetchedValue
, SchemaItem
, SchemaEventTarget
, EventTarget
):
Method | __class |
Undocumented |
Method | __init |
Undocumented |
Class Method | _generate |
Undocumented |
Method | _compiler |
Undocumented |
Class Variable | _original |
Undocumented |
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.
def copy(self, **kw:
Any
) -> Identity
:
(source)
¶
Undocumented