|
definition: |
unique2 :: (Eq a, Eq b, Read a, Read b, Show a, Show b) =>
(Key -> (a,b) -> Dynamic) -> a -> b -> Transaction ()
unique2 entrypred k1 k2 =
getDB (allDBInfos entrypred) |>>= \is ->
if null (filter (== (k1,k2)) is)
then doneT
else errorT (TError UniqueError "relationship already exists")
|
|
demand: |
no demanded arguments |
|
deterministic: |
deterministic operation |
|
documentation: |
Uniqueness of a combination of two attributes. Check whether this combination already exists. If it exists, a transaction error is generated, otherwise everything is ok. |
|
failfree: |
<FAILING> |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,_,_,_,_,_,_,_,_) |-> _}
|
|
name: |
unique2 |
|
precedence: |
no precedence defined |
|
result-values: |
_ |
|
signature: |
(Prelude.Eq a, Prelude.Eq b, Prelude.Read a, Prelude.Read b, Prelude.Show a, Prelude.Show b) => (Prelude.Int -> (a, b) -> Database.KeyDatabaseSQLite.Dynamic) -> a -> b -> Database.KeyDatabaseSQLite.Transaction () |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
possibly non-terminating |
|
totally-defined: |
possibly non-reducible on same data term |