@@ -47,6 +47,7 @@ module Squeal.PostgreSQL.Expression
4747 , nullIf
4848 -- ** Collections
4949 , array
50+ , cardinality
5051 , index
5152 , row
5253 , field
@@ -483,6 +484,11 @@ array
483484array xs = UnsafeExpression $
484485 "ARRAY[" <> commaSeparated (renderSQL <$> xs) <> "]"
485486
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+
486492-- | >>> printSQL $ array [null_, false, true] & index 2
487493-- (ARRAY[NULL, FALSE, TRUE])[2]
488494index