on dev help sign in
json[b]_object_keys
d4638a9Mike Ledger
squeal-postgresql/src/Squeal/PostgreSQL/Expression.hs+13−1
@@ -89,7 +89,7 @@ module Squeal.PostgreSQL.Expression
89 , PGarray
89 , PGarray
90 , PGarrayOf
90 , PGarrayOf
91 , PGjsonKey
91 , PGjsonKey
92− , PGjson
92+ , PGjson_
93 , (.->)
93 , (.->)
94 , (.->>)
94 , (.->>)
95 , (.#>)
95 , (.#>)
@@ -108,6 +108,8 @@ module Squeal.PostgreSQL.Expression
108 , toJsonb
108 , toJsonb
109 , arrayToJson
109 , arrayToJson
110 , rowToJson
110 , rowToJson
111+ , jsonObjectKeys
112+ , jsonbObjectKeys
111 -- ** Aggregation
113 -- ** Aggregation
112 , unsafeAggregate, unsafeAggregateDistinct
114 , unsafeAggregate, unsafeAggregateDistinct
113 , sum_, sumDistinct
115 , sum_, sumDistinct
@@ -1077,6 +1079,16 @@ rowToJson
1077 -> Expression schema relations grouping params (nullity 'PGjson)
1079 -> Expression schema relations grouping params (nullity 'PGjson)
1078rowToJson = unsafeFunction "row_to_json"
1080rowToJson = unsafeFunction "row_to_json"
1079
1081
1082+jsonObjectKeys
1083+ :: Expression schema relations grouping params (nullity 'PGjson)
1084+ -> Expression schema relations grouping params (nullity 'PGtext)
1085+jsonObjectKeys = unsafeFunction "json_object_keys"
1086+
1087+jsonbObjectKeys
1088+ :: Expression schema relations grouping params (nullity 'PGjsonb)
1089+ -> Expression schema relations grouping params (nullity 'PGtext)
1090+jsonbObjectKeys = unsafeFunction "jsonb_object_keys"
1091+
1080-- TODO: jsonBuildArray, jsonbBuildArray, jsonObject, jsonbObject
1092-- TODO: jsonBuildArray, jsonbBuildArray, jsonObject, jsonbObject
1081-- probably something like
1093-- probably something like
1082-- :: NP (Expression s r g p) xs -> Expression s r g p ('NotNull 'PGjson[b])
1094-- :: NP (Expression s r g p) xs -> Expression s r g p ('NotNull 'PGjson[b])