| Copyright | (c) Eitan Chatav 2019 |
|---|---|
| Maintainer | eitan@morphism.tech |
| Stability | experimental |
| Safe Haskell | None |
| Language | Haskell2010 |
Squeal.PostgreSQL.Expression.Array
Contents
Description
array functions
Synopsis
- array :: [Expression grp lat with db params from ty] -> Expression grp lat with db params from (null (PGvararray ty))
- array0 :: TypeExpression db ty -> Expression grp lat with db params from (null (PGvararray ty))
- array1 :: (n ~ Length tys, All ((~) ty) tys) => NP (Expression grp lat with db params from) tys -> Expression grp lat with db params from (null (PGfixarray '[n] ty))
- array2 :: (All ((~) tys) tyss, All SListI tyss, Length tyss ~ n1, All ((~) ty) tys, Length tys ~ n2) => NP (NP (Expression grp lat with db params from)) tyss -> Expression grp lat with db params from (null (PGfixarray '[n1, n2] ty))
- cardinality :: null (PGvararray ty) --> null PGint8
- index :: Word64 -> null (PGvararray ty) --> NullifyType ty
- unnest :: null (PGvararray ty) -|-> ("unnest" ::: '["unnest" ::: ty])
Array Functions
Arguments
| :: [Expression grp lat with db params from ty] | array elements |
| -> Expression grp lat with db params from (null (PGvararray ty)) |
Construct an array.
>>>printSQL $ array [null_, false, true]ARRAY[NULL, FALSE, TRUE]
array0 :: TypeExpression db ty -> Expression grp lat with db params from (null (PGvararray ty)) Source #
Safely construct an empty array.
>>>printSQL $ array0 text(ARRAY[] :: text[])
Arguments
| :: (n ~ Length tys, All ((~) ty) tys) | |
| => NP (Expression grp lat with db params from) tys | array elements |
| -> Expression grp lat with db params from (null (PGfixarray '[n] ty)) |
Construct a fixed length array.
>>>printSQL $ array1 (null_ :* false *: true)ARRAY[NULL, FALSE, TRUE]
>>>:type array1 (null_ :* false *: true)array1 (null_ :* false *: true) :: Expression grp lat with db params from (null ('PGfixarray '[3] ('Null 'PGbool)))
Arguments
| :: (All ((~) tys) tyss, All SListI tyss, Length tyss ~ n1, All ((~) ty) tys, Length tys ~ n2) | |
| => NP (NP (Expression grp lat with db params from)) tyss | matrix elements |
| -> Expression grp lat with db params from (null (PGfixarray '[n1, n2] ty)) |
Construct a fixed size matrix.
>>>printSQL $ array2 ((null_ :* false *: true) *: (false :* null_ *: true))ARRAY[[NULL, FALSE, TRUE], [FALSE, NULL, TRUE]]
>>>:type array2 ((null_ :* false *: true) *: (false :* null_ *: true))array2 ((null_ :* false *: true) *: (false :* null_ *: true)) :: Expression grp lat with db params from (null ('PGfixarray '[2, 3] ('Null 'PGbool)))
cardinality :: null (PGvararray ty) --> null PGint8 Source #
>>>printSQL $ cardinality (array [null_, false, true])cardinality(ARRAY[NULL, FALSE, TRUE])
Arguments
| :: Word64 | index |
| -> null (PGvararray ty) --> NullifyType ty |
>>>printSQL $ array [null_, false, true] & index 2(ARRAY[NULL, FALSE, TRUE])[2]