@@ -6,6 +6,9 @@
66 , OverloadedLabels
77 , OverloadedStrings
88 , PolyKinds
9+ , RankNTypes
10+ , ScopedTypeVariables
11+ , TypeApplications
912 , TypeOperators
1013 , UndecidableInstances
1114#-}
@@ -380,69 +383,63 @@ jsonbPretty = unsafeFunction "jsonb_pretty"
380383-- >>> import Data.Aeson
381384-- >>> printSQL (select Star (from (jsonEach (literal (Json (object ["a" .= "foo", "b" .= "bar"]))))))
382385-- SELECT * FROM json_each(('{"a":"foo","b":"bar"}' :: json))
383−jsonEach
384− :: Expression outer commons 'Ungrouped schemas params '[] (nullity 'PGjson) -- ^ json object
385− -> FromClause outer commons schemas params
386− '["json_each" ::: '["key" ::: 'NotNull 'PGtext, "value" ::: 'NotNull 'PGjson]]
387−jsonEach = unsafeSetOfFunction "json_each"
386+jsonEach :: SetOfFunction "json_each" (null 'PGjson)
387+ '["key" ::: 'NotNull 'PGtext, "value" ::: 'NotNull 'PGjson]
388+jsonEach = unsafeSetOfFunction #json_each
388389
389390-- | Expands the outermost binary JSON object into a set of key/value pairs.
390391-- >>> import Data.Aeson
391392-- >>> printSQL (select Star (from (jsonbEach (literal (Jsonb (object ["a" .= "foo", "b" .= "bar"]))))))
392393-- SELECT * FROM jsonb_each(('{"a":"foo","b":"bar"}' :: jsonb))
393394jsonbEach
394− :: Expression outer commons 'Ungrouped schemas params '[] (nullity 'PGjsonb) -- ^ jsonb object
395− -> FromClause outer commons schemas params
396− '["jsonb_each" ::: '["key" ::: 'NotNull 'PGtext, "value" ::: 'NotNull 'PGjson]]
397−jsonbEach = unsafeSetOfFunction "jsonb_each"
395+ :: SetOfFunction "jsonb_each" (nullity 'PGjsonb)
396+ '["key" ::: 'NotNull 'PGtext, "value" ::: 'NotNull 'PGjson]
397+jsonbEach = unsafeSetOfFunction #jsonb_each
398398
399399-- | Expands the outermost JSON object into a set of key/value pairs.-- | Expands the outermost binary JSON object into a set of key/value pairs.
400400-- >>> import Data.Aeson
401401-- >>> printSQL (select Star (from (jsonEachText (literal (Json (object ["a" .= "foo", "b" .= "bar"]))))))
402402-- SELECT * FROM json_each_text(('{"a":"foo","b":"bar"}' :: json))
403403jsonEachText
404− :: Expression outer commons 'Ungrouped schemas params '[] (nullity 'PGjson) -- ^ json object
405− -> FromClause outer commons schemas params
406− '["json_each" ::: '["key" ::: 'NotNull 'PGtext, "value" ::: 'NotNull 'PGtext]]
407−jsonEachText = unsafeSetOfFunction "json_each_text"
404+ :: SetOfFunction "json_each_text" (null 'PGjson)
405+ '["key" ::: 'NotNull 'PGtext, "value" ::: 'NotNull 'PGtext]
406+jsonEachText = unsafeSetOfFunction #json_each_text
408407
409408-- | Expands the outermost binary JSON object into a set of key/value pairs.
410409-- >>> import Data.Aeson
411410-- >>> printSQL (select Star (from (jsonbEachText (literal (Jsonb (object ["a" .= "foo", "b" .= "bar"]))))))
412411-- SELECT * FROM jsonb_each_text(('{"a":"foo","b":"bar"}' :: jsonb))
413412jsonbEachText
414− :: Expression outer commons 'Ungrouped schemas params '[] (nullity 'PGjsonb) -- ^ jsonb object
415− -> FromClause outer commons schemas params
416− '["jsonb_each" ::: '["key" ::: 'NotNull 'PGtext, "value" ::: 'NotNull 'PGtext]]
417−jsonbEachText = unsafeSetOfFunction "jsonb_each_text"
413+ :: SetOfFunction "jsonb_each_text" (null 'PGjsonb)
414+ '["key" ::: 'NotNull 'PGtext, "value" ::: 'NotNull 'PGtext]
415+jsonbEachText = unsafeSetOfFunction #jsonb_each_text
418416
419417-- | Returns set of keys in the outermost JSON object.
420418-- >>> import Data.Aeson
421419-- >>> printSQL (jsonObjectKeys (literal (Json (object ["a" .= "foo", "b" .= "bar"]))))
422420-- json_object_keys(('{"a":"foo","b":"bar"}' :: json))
423421jsonObjectKeys
424− :: Expression outer commons 'Ungrouped schemas params '[] (nullity 'PGjson) -- ^ json object
425− -> FromClause outer commons schemas params
426− '["json_object_keys" ::: '["json_object_keys" ::: 'NotNull 'PGtext]]
427−jsonObjectKeys = unsafeSetOfFunction "json_object_keys"
422+ :: SetOfFunction "json_object_keys" (nullity 'PGjson)
423+ '["json_object_keys" ::: 'NotNull 'PGtext]
424+jsonObjectKeys = unsafeSetOfFunction #json_object_keys
428425
429426-- | Returns set of keys in the outermost JSON object.
430427-- >>> import Data.Aeson
431428-- >>> printSQL (jsonbObjectKeys (literal (Jsonb (object ["a" .= "foo", "b" .= "bar"]))))
432429-- jsonb_object_keys(('{"a":"foo","b":"bar"}' :: jsonb))
433430jsonbObjectKeys
434− :: Expression outer commons 'Ungrouped schemas params '[] (nullity 'PGjsonb) -- ^ jsonb object
435− -> FromClause outer commons schemas params
436− '["jsonb_object_keys" ::: '["jsonb_object_keys" ::: 'NotNull 'PGtext]]
437−jsonbObjectKeys = unsafeSetOfFunction "jsonb_object_keys"
431+ :: SetOfFunction "jsonb_object_keys" (null 'PGjsonb)
432+ '["jsonb_object_keys" ::: 'NotNull 'PGtext]
433+jsonbObjectKeys = unsafeSetOfFunction #jsonb_object_keys
438434
439435unsafePopulateFunction
440− :: KnownSymbol fun
436+ :: forall fun schemas null outer commons params ty row
437+ . KnownSymbol fun
441438 => Alias fun
442− -> TypeExpression schemas (nullity ('PGcomposite row))
443− -> Expression outer commons 'Ungrouped schemas params '[] ty
439+ -> TypeExpression schemas (null ('PGcomposite row))
440+ -> Expression outer commons 'Ungrouped schemas params '[] ty
444441 -> FromClause outer commons schemas params '[fun ::: row]
445−unsafePopulateFunction fun ty expr = UnsafeFromClause $ renderSQL fun
442+unsafePopulateFunction _fun ty expr = UnsafeFromClause $ renderSymbol @fun
446443 <> parenthesized ("null::" <> renderSQL ty <> ", " <> renderSQL expr)
447444
448445-- | Expands the JSON expression to a row whose columns match the record