MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / __init__

Method __init__

lib/sqlalchemy/sql/schema.py:6100–6173  ·  view source on GitHub ↗

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 preferr

(
        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 from the content-addressed store, hash-verified

6098 is_identity = True
6099
6100 def __init__(
6101 self,
6102 always: bool = False,
6103 on_null: Optional[bool] = None,
6104 start: Optional[int] = None,
6105 increment: Optional[int] = None,
6106 minvalue: Optional[int] = None,
6107 maxvalue: Optional[int] = None,
6108 nominvalue: Optional[bool] = None,
6109 nomaxvalue: Optional[bool] = None,
6110 cycle: Optional[bool] = None,
6111 cache: Optional[int] = None,
6112 order: Optional[bool] = None,
6113 ) -> None:
6114 """Construct a GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY DDL
6115 construct to accompany a :class:`_schema.Column`.
6116
6117 See the :class:`.Sequence` documentation for a complete description
6118 of most parameters.
6119
6120 .. note::
6121 MSSQL supports this construct as the preferred alternative to
6122 generate an IDENTITY on a column, but it uses non standard
6123 syntax that only support :paramref:`_schema.Identity.start`
6124 and :paramref:`_schema.Identity.increment`.
6125 All other parameters are ignored.
6126
6127 :param always:
6128 A boolean, that indicates the type of identity column.
6129 If ``False`` is specified, the default, then the user-specified
6130 value takes precedence.
6131 If ``True`` is specified, a user-specified value is not accepted (
6132 on some backends, like PostgreSQL, OVERRIDING SYSTEM VALUE, or
6133 similar, may be specified in an INSERT to override the sequence
6134 value).
6135 Some backends also have a default value for this parameter,
6136 ``None`` can be used to omit rendering this part in the DDL. It
6137 will be treated as ``False`` if a backend does not have a default
6138 value.
6139
6140 :param on_null:
6141 Set to ``True`` to specify ON NULL in conjunction with a
6142 ``always=False`` identity column. This option is only supported on
6143 some backends, like Oracle Database.
6144
6145 :param start: the starting index of the sequence.
6146 :param increment: the increment value of the sequence.
6147 :param minvalue: the minimum value of the sequence.
6148 :param maxvalue: the maximum value of the sequence.
6149 :param nominvalue: no minimum value of the sequence.
6150 :param nomaxvalue: no maximum value of the sequence.
6151 :param cycle: allows the sequence to wrap around when the maxvalue
6152 or minvalue has been reached.
6153 :param cache: optional integer value; number of future values in the
6154 sequence which are calculated in advance.
6155 :param order: optional boolean value; if true, renders the
6156 ORDER keyword.
6157

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected