neuralib.sqlp.table.CheckConstraint

class neuralib.sqlp.table.CheckConstraint[source]

Bases: NamedTuple

SQL check constraint

__init__()

Methods

__init__()

count(value, /)

Return number of occurrences of value.

index(value[, start, stop])

Return first index of value.

Attributes

expression

checking expression

field

associated field's name.

name

constraint name

table

associated table

static __new__(_cls, name, table, field, expression)

Create new instance of CheckConstraint(name, table, field, expression)

Parameters:
  • name (str)

  • table (type)

  • field (str | None)

  • expression (SqlExpr)

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

name: str

constraint name

table: type

associated table

field: str | None

associated field’s name.

expression: SqlExpr

checking expression