on dev help sign in
cardinality
commit33ff5bf02d1b834b19f91145b90596aee11da146 authorEitan Chatav <eitan@Eitans-MacBook-Pro.local> dateWed 27 Feb 2019, 11:23 (8 years ago) parent3508c3e
1 file changed+6
squeal-postgresql/src/Squeal/PostgreSQL/Expression.hs+6
squeal-postgresql/src/Squeal/PostgreSQL/Expression.hs+6
@@ -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