MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / __init__

Method __init__

lib/sqlalchemy/sql/schema.py:6565–6648  ·  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: Optional[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,
        **dialect_kw: Any,
    )

Source from the content-addressed store, hash-verified

6563 ),
6564 )
6565 def __init__(
6566 self,
6567 always: Optional[bool] = False,
6568 on_null: Optional[bool] = None,
6569 start: Optional[int] = None,
6570 increment: Optional[int] = None,
6571 minvalue: Optional[int] = None,
6572 maxvalue: Optional[int] = None,
6573 nominvalue: Optional[bool] = None,
6574 nomaxvalue: Optional[bool] = None,
6575 cycle: Optional[bool] = None,
6576 cache: Optional[int] = None,
6577 order: Optional[bool] = None,
6578 **dialect_kw: Any,
6579 ) -> None:
6580 """Construct a GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY DDL
6581 construct to accompany a :class:`_schema.Column`.
6582
6583 See the :class:`.Sequence` documentation for a complete description
6584 of most parameters.
6585
6586 .. note::
6587 MSSQL supports this construct as the preferred alternative to
6588 generate an IDENTITY on a column, but it uses non standard
6589 syntax that only support :paramref:`_schema.Identity.start`
6590 and :paramref:`_schema.Identity.increment`.
6591 All other parameters are ignored.
6592
6593 :param always:
6594 A boolean, that indicates the type of identity column.
6595 If ``False`` is specified, the default, then the user-specified
6596 value takes precedence.
6597 If ``True`` is specified, a user-specified value is not accepted (
6598 on some backends, like PostgreSQL, OVERRIDING SYSTEM VALUE, or
6599 similar, may be specified in an INSERT to override the sequence
6600 value).
6601 Some backends also have a default value for this parameter,
6602 ``None`` can be used to omit rendering this part in the DDL. It
6603 will be treated as ``False`` if a backend does not have a default
6604 value.
6605
6606 :param on_null:
6607 Set to ``True`` to specify ON NULL in conjunction with a
6608 ``always=False`` identity column. This option is only supported on
6609 some backends, like Oracle Database.
6610
6611 :param start: the starting index of the sequence.
6612 :param increment: the increment value of the sequence.
6613 :param minvalue: the minimum value of the sequence.
6614 :param maxvalue: the maximum value of the sequence.
6615 :param nominvalue: no minimum value of the sequence.
6616 :param nomaxvalue: no maximum value of the sequence.
6617 :param cycle: allows the sequence to wrap around when the maxvalue
6618 or minvalue has been reached.
6619 :param cache: optional integer value; number of future values in the
6620 sequence which are calculated in advance.
6621 :param order: optional boolean value; if true, renders the
6622 ORDER keyword.

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected