Portability | unknown |
---|---|
Stability | experimental |
Maintainer | [email protected] |
Safe Haskell | None |
Database.Relational.Query.Constraint
Description
This module provides proof object definitions of constraint key. Difference between this module and Database.Record.KeyConstraint is typed constraint key column definition is included in this module.
- data Key c r ct
- indexes :: Key c r ct -> [Int]
- unsafeDefineConstraintKey :: PersistableWidth ct => [Int] -> Key c r ct
- tableConstraint :: Key c r ct -> KeyConstraint c r
- projectionKey :: Key c r ct -> Pi r ct
- uniqueKey :: PersistableWidth ct => Key Primary r ct -> Key Unique r ct
- class PersistableWidth ct => HasConstraintKey c r ct where
- constraintKey :: Key c r ct
- derivedUniqueKey :: HasConstraintKey Primary r ct => Key Unique r ct
- data Primary
- data Unique
- data NotNull
Constraint Key proof object
Constraint Key proof object. Constraint type c
, record type r
and columns type ct
.
unsafeDefineConstraintKeySource
Arguments
:: PersistableWidth ct | |
=> [Int] | Key indexes which specify this constraint key |
-> Key c r ct | Result constraint key proof object |
Unsafely generate constraint Key
proof object using specified key index.
tableConstraint :: Key c r ct -> KeyConstraint c rSource
Get table constraint KeyConstraint
proof object from constraint Key
.
projectionKey :: Key c r ct -> Pi r ctSource
Get projection path proof object from constraint Key
.
Derivation rules
Inference rules
class PersistableWidth ct => HasConstraintKey c r ct whereSource
Constraint Key
inference interface.
derivedUniqueKey :: HasConstraintKey Primary r ct => Key Unique r ctSource
Constraint types
data Primary
Constraint type. Primary key.
data Unique
Constraint type. Unique key.
data NotNull
Constraint type. Not-null key.
Instances
HasColumnConstraint NotNull Bool | |
HasColumnConstraint NotNull Char | |
HasColumnConstraint NotNull Int8 | |
HasColumnConstraint NotNull Int16 | |
HasColumnConstraint NotNull Int32 | |
HasColumnConstraint NotNull Int64 | |
HasColumnConstraint NotNull String | |
HasColumnConstraint NotNull a => HasColumnConstraint NotNull (a, b) | Inference rule of |