@@ -32,7 +32,7 @@ module Database.Beam.Postgres.PgSpecific
32
32
33
33
, (@>) , (<@) , (->#) , (->$)
34
34
, (->>#) , (->>$) , (#>) , (#>>)
35
- , (?) , (?|) , (?&)
35
+ , (?) , (?|) , (?&) , (||.)
36
36
37
37
, withoutKey , withoutIdx
38
38
, withoutKeys
@@ -114,7 +114,7 @@ module Database.Beam.Postgres.PgSpecific
114
114
)
115
115
where
116
116
117
- import Database.Beam hiding (char , double )
117
+ import Database.Beam hiding ((||.) , char , double )
118
118
import Database.Beam.Backend.SQL
119
119
import Database.Beam.Migrate ( HasDefaultSqlDataType (.. ) )
120
120
import Database.Beam.Postgres.Syntax
@@ -960,6 +960,13 @@ QExpr a ?| QExpr b =
960
960
QExpr a ?& QExpr b =
961
961
QExpr (pgBinOp " ?&" <$> a <*> b)
962
962
963
+ -- | Postgres @||@ operator. Concatenates two jsonb values into a new jsonb value.
964
+ (||.) :: QGenExpr ctxt Postgres s (PgJSONB a )
965
+ -> QGenExpr ctxt Postgres s (PgJSONB a )
966
+ -> QGenExpr ctxt Postgres s (PgJSONB a )
967
+ QExpr a ||. QExpr b =
968
+ QExpr (pgBinOp " ||" <$> a <*> b)
969
+
963
970
-- | Postgres @-@ operator on json objects. Returns the supplied json object
964
971
-- with the supplied key deleted. See 'withoutIdx' for the corresponding
965
972
-- operator on arrays.
0 commit comments