on dev help sign in
cardinality
33ff5bfEitan Chatav
squeal-postgresql/src/Squeal/PostgreSQL/Expression.hs+6
@@ -47,6 +47,7 @@ module Squeal.PostgreSQL.Expression
47 , nullIf
47 , nullIf
48 -- ** Collections
48 -- ** Collections
49 , array
49 , array
50+ , cardinality
50 , index
51 , index
51 , row
52 , row
52 , field
53 , field
@@ -483,6 +484,11 @@ array
483array xs = UnsafeExpression $
484array xs = UnsafeExpression $
484 "ARRAY[" <> commaSeparated (renderSQL <$> xs) <> "]"
485 "ARRAY[" <> commaSeparated (renderSQL <$> xs) <> "]"
485
486
487+cardinality
488+ :: Expression outer grp commons schemas params from (nullity ('PGvararray ty))
489+ -> Expression outer grp commons schemas params from (nullity 'PGint8)
490+cardinality = unsafeFunction "cardinality"
491+
486-- | >>> printSQL $ array [null_, false, true] & index 2
492-- | >>> printSQL $ array [null_, false, true] & index 2
487-- (ARRAY[NULL, FALSE, TRUE])[2]
493-- (ARRAY[NULL, FALSE, TRUE])[2]
488index
494index