bedrock.db.constraints

 1from sqlalchemy import UniqueConstraint
 2
 3
 4class NonIdentifyingUniqueConstraint(UniqueConstraint):  # pragma: unit
 5    """
 6    Custom UniqueConstraint where one or more of the Columns don't necessarily identify a unique record.
 7
 8    This is not different from `sqlalchemy`'s `UniqueConstraint`
 9    """
10
11    def __init__(self, *args, **kwargs):
12        super().__init__(*args, **kwargs)
class NonIdentifyingUniqueConstraint(sqlalchemy.sql.schema.UniqueConstraint):
 5class NonIdentifyingUniqueConstraint(UniqueConstraint):  # pragma: unit
 6    """
 7    Custom UniqueConstraint where one or more of the Columns don't necessarily identify a unique record.
 8
 9    This is not different from `sqlalchemy`'s `UniqueConstraint`
10    """
11
12    def __init__(self, *args, **kwargs):
13        super().__init__(*args, **kwargs)

Custom UniqueConstraint where one or more of the Columns don't necessarily identify a unique record.

This is not different from sqlalchemy's UniqueConstraint

NonIdentifyingUniqueConstraint(*args, **kwargs)
12    def __init__(self, *args, **kwargs):
13        super().__init__(*args, **kwargs)
Parameters
  • *columns: A sequence of column names or Column objects.

  • name: Optional, the in-database name of this constraint.

  • deferrable: Optional bool. If set, emit DEFERRABLE or NOT DEFERRABLE when issuing DDL for this constraint.

  • initially: Optional string. If set, emit INITIALLY when issuing DDL for this constraint.

  • *dialect_kw*: other keyword arguments including dialect-specific arguments are propagated to the .Constraint superclass.