pg-schema 0.7.1.0 → 0.7.1.1
raw patch · 4 files changed
+20/−3 lines, 4 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ PgSchema.DML: upsertJSONText :: forall (ann :: Ann) -> forall r r'. (TreeSch ann, CRecInfo ann r, CRecInfo ann r', IsString s, Monoid s, Ord s) => s
+ PgSchema.DML: upsertJSONText_ :: forall (ann :: Ann) -> forall r s. (IsString s, Monoid s, Ord s, TreeSch ann, CRecInfo ann r) => s
Files
- ChangeLog.md +3/−0
- pg-schema.cabal +1/−1
- src/PgSchema/DML.hs +2/−1
- src/PgSchema/DML/InsertJSON.hs +14/−1
ChangeLog.md view
@@ -1,5 +1,8 @@ # Changelog for pg-schema +## 0.7.1.1+- Add upsertJSONText, upsertJSONText_+ ## 0.7.1.0 - Condition DSL: `(=??)` on nullable columns generates SQL `IS NOT DISTINCT FROM` (same null-safe key equality as upsertJSON)
pg-schema.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.12 name: pg-schema-version: 0.7.1.0+version: 0.7.1.1 category: Database author: Dmitry Olshansky maintainer: olshanskydr@gmail.com
src/PgSchema/DML.hs view
@@ -103,7 +103,8 @@ , updateByCond, updateByCond_, updateText, updateText_ , UpdateReturning, UpdateNonReturning, CRecInfo(..) -- ** Tree-base Insert/Upsert- , insertJSON, insertJSON_, upsertJSON, upsertJSON_, insertJSONText, insertJSONText_+ , insertJSON, insertJSON_, upsertJSON, upsertJSON_+ , insertJSONText, insertJSONText_, upsertJSONText, upsertJSONText_ , TreeIn, TreeOut, AllMandatoryTree, AllMandatoryOrHasKeyTree, TreeSch , InsertTreeNonReturning, InsertTreeReturning , UpsertTreeNonReturning, UpsertTreeReturning, TRecordInfo
src/PgSchema/DML/InsertJSON.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE OverloadedRecordDot #-} module PgSchema.DML.InsertJSON ( insertJSON, insertJSON_, upsertJSON, upsertJSON_- , insertJSONText, insertJSONText_ ) where+ , insertJSONText, insertJSONText_, upsertJSONText, upsertJSONText_ ) where import Control.Monad import Control.Monad.RWS@@ -145,6 +145,19 @@ , IsString s, Monoid s, Ord s ) => s insertJSONText ann @r @r' = insertJSONText' True (typDefMap @(AnnSch ann)) (tabInfoMap @(AnnSch ann))+ (getRecordInfo @ann @r) (getRecordInfo @ann @r').fields++upsertJSONText_ :: forall ann -> forall r s.+ (IsString s, Monoid s, Ord s, TreeSch ann, CRecInfo ann r) => s+upsertJSONText_ ann @r =+ insertJSONText' False (typDefMap @(AnnSch ann)) (tabInfoMap @(AnnSch ann))+ (getRecordInfo @ann @r) []++upsertJSONText :: forall ann -> forall r r'.+ ( TreeSch ann, CRecInfo ann r, CRecInfo ann r'+ , IsString s, Monoid s, Ord s ) => s+upsertJSONText ann @r @r' =+ insertJSONText' False (typDefMap @(AnnSch ann)) (tabInfoMap @(AnnSch ann)) (getRecordInfo @ann @r) (getRecordInfo @ann @r').fields -- | @isInsertOnly@: plain @INSERT@ only ('insertJSON'); 'False' enables upsert