| Copyright | 2013-2017 Kei Hibino |
|---|---|
| License | BSD3 |
| Maintainer | ex8k.hibino@gmail.com |
| Stability | experimental |
| Portability | unknown |
| Safe Haskell | None |
| Language | Haskell2010 |
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
- 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.
unsafeDefineConstraintKey Source #
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 r Source #
Get table constraint KeyConstraint proof object from constraint Key.
projectionKey :: Key c r ct -> Pi r ct Source #
Get projection path proof object from constraint Key.
Derivation rules
Inference rules
class PersistableWidth ct => HasConstraintKey c r ct where Source #
Constraint Key inference interface.
Minimal complete definition
derivedUniqueKey :: HasConstraintKey Primary r ct => Key Unique r ct Source #
Constraint types
Constraint type. Not-null key.
Instances
| HasColumnConstraint NotNull a => HasColumnConstraint NotNull (a, b) | Inference rule of |