@@ -47,6 +47,7 @@ module Squeal.PostgreSQL.Expression
48 -- ** Collections
48 -- ** Collections
@@ -483,6 +484,13 @@ array
483array xs = UnsafeExpression $
484array xs = UnsafeExpression $
484 "ARRAY[" <> commaSeparated (renderSQL <$> xs) <> "]"
485 "ARRAY[" <> commaSeparated (renderSQL <$> xs) <> "]"
487+-- | >>> printSQL $ cardinality (array [null_, false, true])
488+-- cardinality(ARRAY[NULL, FALSE, TRUE])
490+ :: Expression outer grp commons schemas params from (nullity ('PGvararray ty))
491+ -> Expression outer grp commons schemas params from (nullity 'PGint8)
492+cardinality = unsafeFunction "cardinality"
486-- | >>> printSQL $ array [null_, false, true] & index 2
494-- | >>> printSQL $ array [null_, false, true] & index 2
487-- (ARRAY[NULL, FALSE, TRUE])[2]
495-- (ARRAY[NULL, FALSE, TRUE])[2]