@@ -52,6 +52,8 @@ module Squeal.PostgreSQL.Query
5252 -- ** With
5353 , With (..)
5454 , CommonTableExpression (..)
55+ -- ** Unnest
56+ , unnest
5557 -- ** Json
5658 , jsonEach
5759 , jsonbEach
@@ -718,6 +720,11 @@ unsafeSetOfFunction
718720unsafeSetOfFunction fun expr = UnsafeQuery $
719721 "SELECT * FROM " <> fun <> "(" <> renderSQL expr <> ")"
720722
723+unnest
724+ :: Expression outer 'Ungrouped commons schemas params '[] (nullity ('PGvararray ty))
725+ -> Query outer commons schemas params '[ "unnest" ::: ty ]
726+unnest = unsafeSetOfFunction "unnest"
727+
721728-- | Expands the outermost JSON object into a set of key/value pairs.
722729jsonEach
723730 :: Expression outer 'Ungrouped commons schemas params '[] (nullity 'PGjson) -- ^ json object