Copyright | 2013 Kei Hibino |
---|---|
License | BSD3 |
Maintainer | ex8k.hibino@gmail.com |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell2010 |
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
.
unsafeDefineConstraintKey Source
:: 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.
constraintKey :: Key c r ct Source
Infer constraint key.
derivedUniqueKey :: HasConstraintKey Primary r ct => Key Unique r ct Source
Constraint types
data Primary :: *
Constraint type. Primary key.
data Unique :: *
Constraint type. Unique key.
data NotNull :: *
Constraint type. Not-null key.
HasColumnConstraint NotNull a => HasColumnConstraint NotNull (a, b) | Inference rule of |