@@ -32,7 +32,7 @@ module Database.Beam.Postgres.PgSpecific
3232
3333 , (@>) , (<@) , (->#) , (->$)
3434 , (->>#) , (->>$) , (#>) , (#>>)
35- , (?) , (?|) , (?&)
35+ , (?) , (?|) , (?&) , (||.)
3636
3737 , withoutKey , withoutIdx
3838 , withoutKeys
@@ -114,7 +114,7 @@ module Database.Beam.Postgres.PgSpecific
114114 )
115115where
116116
117- import Database.Beam hiding (char , double )
117+ import Database.Beam hiding ((||.) , char , double )
118118import Database.Beam.Backend.SQL
119119import Database.Beam.Migrate ( HasDefaultSqlDataType (.. ) )
120120import Database.Beam.Postgres.Syntax
@@ -960,6 +960,13 @@ QExpr a ?| QExpr b =
960960QExpr a ?& QExpr b =
961961 QExpr (pgBinOp " ?&" <$> a <*> b)
962962
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+
963970-- | Postgres @-@ operator on json objects. Returns the supplied json object
964971-- with the supplied key deleted. See 'withoutIdx' for the corresponding
965972-- operator on arrays.
0 commit comments