appendful-persistent 0.1.0.0 → 0.1.0.1
raw patch · 5 files changed
+31/−3 lines, 5 files
Files
- ChangeLog.md +8/−0
- appendful-persistent.cabal +4/−2
- src/Data/Appendful/Persistent.hs +16/−0
- test/TestUtils/ClientDB.hs +1/−0
- test/TestUtils/ServerDB.hs +2/−1
+ ChangeLog.md view
@@ -0,0 +1,8 @@+# Changelog for appendful++## [0.1.0.0] - 2022-06-19++### Added++* Autodocodec support+
appendful-persistent.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.0.+-- This file has been generated from package.yaml by hpack version 0.35.2. -- -- see: https://github.com/sol/hpack name: appendful-persistent-version: 0.1.0.0+version: 0.1.0.1 description: Persistent integration for ppend-only cooperative agreement homepage: https://github.com/NorfairKing/appendful#readme bug-reports: https://github.com/NorfairKing/appendful/issues@@ -14,6 +14,8 @@ copyright: Copyright: (c) 2020-2022 Tom Sydney Kerckhove license: MIT build-type: Simple+extra-source-files:+ ChangeLog.md source-repository head type: git
src/Data/Appendful/Persistent.hs view
@@ -1,8 +1,12 @@+{-# LANGUAGE CPP #-}+{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}+{-# OPTIONS_GHC -Wno-redundant-constraints #-} module Data.Appendful.Persistent ( -- * Client side@@ -74,6 +78,7 @@ ( PersistEntity clientRecord, PersistField sid, PersistEntityBackend clientRecord ~ SqlBackend,+ SafeToInsert clientRecord, MonadIO m ) => -- | Create an un-deleted synced record on the client side@@ -88,6 +93,7 @@ ( PersistEntity clientRecord, PersistField sid, PersistEntityBackend clientRecord ~ SqlBackend,+ SafeToInsert clientRecord, MonadIO m ) => -- | Create an un-deleted synced record on the client side@@ -106,6 +112,7 @@ serverProcessSyncQuery :: ( PersistEntity record, PersistEntityBackend record ~ SqlBackend,+ SafeToInsert record, MonadIO m ) => -- | Filters to select the relevant items@@ -124,6 +131,7 @@ serverSyncProcessor :: ( PersistEntity record, PersistEntityBackend record ~ SqlBackend,+ SafeToInsert record, MonadIO m ) => -- | Filters to select the relevant items@@ -146,6 +154,7 @@ ( Ord sid, PersistEntity record, PersistEntityBackend record ~ SqlBackend,+ SafeToInsert record, MonadIO m ) => -- | The action to generate new identifiers@@ -167,6 +176,7 @@ ( Ord sid, PersistEntity record, PersistEntityBackend record ~ SqlBackend,+ SafeToInsert record, MonadIO m ) => -- | The action to generate new identifiers@@ -196,6 +206,7 @@ setupUnsyncedClientQuery :: ( PersistEntity clientRecord, PersistEntityBackend clientRecord ~ SqlBackend,+ SafeToInsert clientRecord, MonadIO m ) => -- | How to insert a _new_ record@@ -210,6 +221,7 @@ setupClientQuery :: ( PersistEntity clientRecord, PersistEntityBackend clientRecord ~ SqlBackend,+ SafeToInsert clientRecord, MonadIO m ) => -- | Create an un-deleted unsynced record on the client side@@ -283,3 +295,7 @@ ServerStore (Key record) a -> SqlPersistT m () setupServerQuery func ServerStore {..} = forM_ (M.toList serverStoreItems) $ \(i, e) -> void $ insertKey i $ func e++#if !MIN_VERSION_persistent(2,14,0)+type SafeToInsert a = a ~ a+#endif
test/TestUtils/ClientDB.hs view
@@ -10,6 +10,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module TestUtils.ClientDB where
test/TestUtils/ServerDB.hs view
@@ -10,6 +10,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module TestUtils.ServerDB where@@ -54,7 +55,7 @@ serverGetStoreThingQuery :: SqlPersistT IO (ServerStore ServerThingId Thing) serverGetStoreThingQuery = serverGetStoreQuery serverMakeThing -serverProcessSyncThingQuery :: Ord cid => SyncRequest cid ServerThingId Thing -> SqlPersistT IO (SyncResponse cid ServerThingId Thing)+serverProcessSyncThingQuery :: SyncRequest cid ServerThingId Thing -> SqlPersistT IO (SyncResponse cid ServerThingId Thing) serverProcessSyncThingQuery = serverProcessSyncQuery [] serverMakeThing makeServerThing serverMakeThing :: ServerThing -> Thing