persistent-sql-lifted 0.1.0.0 → 0.1.1.0
raw patch · 7 files changed
+57/−14 lines, 7 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Database.Persist.Sql.Lifted: transactionSave :: forall m. (MonadSqlBackend m, HasCallStack) => m ()
+ Database.Persist.Sql.Lifted: transactionSaveWithIsolation :: forall m. (MonadSqlBackend m, HasCallStack) => IsolationLevel -> m ()
+ Database.Persist.Sql.Lifted: transactionUndo :: forall m. (MonadSqlBackend m, HasCallStack) => m ()
+ Database.Persist.Sql.Lifted: transactionUndoWithIsolation :: forall m. (MonadSqlBackend m, HasCallStack) => IsolationLevel -> m ()
+ Database.Persist.Sql.Lifted.Persistent: transactionSave :: forall m. (MonadSqlBackend m, HasCallStack) => m ()
+ Database.Persist.Sql.Lifted.Persistent: transactionSaveWithIsolation :: forall m. (MonadSqlBackend m, HasCallStack) => IsolationLevel -> m ()
+ Database.Persist.Sql.Lifted.Persistent: transactionUndo :: forall m. (MonadSqlBackend m, HasCallStack) => m ()
+ Database.Persist.Sql.Lifted.Persistent: transactionUndoWithIsolation :: forall m. (MonadSqlBackend m, HasCallStack) => IsolationLevel -> m ()
Files
- CHANGELOG.md +9/−4
- LICENSE +1/−1
- README.md +1/−1
- library/Database/Persist/Sql/Lifted.hs +6/−0
- library/Database/Persist/Sql/Lifted/Persistent.hs +32/−0
- package.yaml +3/−3
- persistent-sql-lifted.cabal +5/−5
CHANGELOG.md view
@@ -1,9 +1,14 @@-## [_Unreleased_](https://github.com/freckle/freckle-app/compare/persistent-sql-lifted-v0.1.0.0...main)+## [_Unreleased_](https://github.com/freckle/persistent-sql-lifted/compare/persistent-sql-lifted-v0.1.1.0...main) -## [v0.0.0.1](https://github.com/freckle/freckle-app/compare/persistent-sql-lifted-v0.0.0.0...persistent-sql-lifted-v0.1.0.0)+## [v0.1.1.0](https://github.com/freckle/persistent-sql-lifted/compare/persistent-sql-lifted-v0.1.0.0...persistent-sql-lifted-v0.1.1.0) -Major expansion, adding query runners for Persistent and Esqueleto.+New: -## [v0.0.0.0](https://github.com/freckle/freckle-app/tree/persistent-sql-lifted-v0.0.0.0/persistent-sql-lifted)+- `transactionSave`+- `transactionSaveWithIsolation`+- `transactionUndo`+- `transactionUndoWithIsolation`++## [v0.1.0.0](https://github.com/freckle/persistent-sql-lifted/tree/persistent-sql-lifted-v0.0.0.0/persistent-sql-lifted) First release, sprouted from `freckle-app-1.20.3.0`.
LICENSE view
@@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2023-2024 Renaissance Learning Inc+Copyright (c) 2024-2025 Renaissance Learning Inc Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
README.md view
@@ -6,7 +6,7 @@ - `MonadSqlBackend db m`, for monadic contexts `m` in which we can execute a SQL transaction of type `db a` and get a result `m a`. (The type `db` should have an- instance of `MonadSqlBackend.)+ instance of `MonadSqlBackend`.) Additionally, this package provides variants of query-running utilities from [persistent] and [esqueleto] which are
library/Database/Persist/Sql/Lifted.hs view
@@ -85,6 +85,12 @@ , deleteWhere , deleteCount + -- * Transactions+ , transactionSave+ , transactionSaveWithIsolation+ , transactionUndo+ , transactionUndoWithIsolation+ -- * Rendering queries to text , renderQueryDelete , renderQueryInsertInto
library/Database/Persist/Sql/Lifted/Persistent.hs view
@@ -37,6 +37,10 @@ , selectKeys , selectKeysList , selectList+ , transactionSave+ , transactionSaveWithIsolation+ , transactionUndo+ , transactionUndoWithIsolation , update , updateGet , updateWhere@@ -66,6 +70,8 @@ ) import Database.Persist.Class qualified as P import Database.Persist.Class.PersistEntity (SafeToInsert)+import Database.Persist.Sql (IsolationLevel)+import Database.Persist.Sql qualified as P import Database.Persist.Sql.Lifted.Core (MonadSqlBackend, SqlBackend, liftSql) import GHC.Stack (HasCallStack) @@ -556,6 +562,32 @@ -> m [Entity a] -- ^ Entities corresponding to the filters and options provided selectList fs os = liftSql $ P.selectList fs os++-- | Commit the current transaction and begin a new one+transactionSave :: forall m. (MonadSqlBackend m, HasCallStack) => m ()+transactionSave = liftSql P.transactionSave++-- | Commit the current transaction and begin a new one+transactionSaveWithIsolation+ :: forall m+ . (MonadSqlBackend m, HasCallStack)+ => IsolationLevel+ -- ^ Isolation level+ -> m ()+transactionSaveWithIsolation il = liftSql $ transactionSaveWithIsolation il++-- | Roll back the current transaction and begin a new one+transactionUndo :: forall m. (MonadSqlBackend m, HasCallStack) => m ()+transactionUndo = liftSql transactionUndo++-- | Roll back the current transaction and begin a new one+transactionUndoWithIsolation+ :: forall m+ . (MonadSqlBackend m, HasCallStack)+ => IsolationLevel+ -- ^ Isolation level+ -> m ()+transactionUndoWithIsolation il = liftSql $ transactionUndoWithIsolation il -- | Update individual fields on a specific record update
package.yaml view
@@ -1,13 +1,13 @@ name: persistent-sql-lifted-version: 0.1.0.0+version: 0.1.1.0 maintainer: Freckle Education category: Database-github: freckle/freckle-app+github: freckle/persistent-sql-lifted synopsis: Monad classes for running queries with Persistent and Esqueleto description: | This package introduces two classes: MonadSqlBackend for monadic contexts in- which a SqlBackend is available, and MonadSqlBackend for contexts in which we+ which a SqlBackend is available, and MonadSqlTx for contexts in which we can execute a SQL transaction. Additionally, this package provides variants of query-running utilities from
persistent-sql-lifted.cabal view
@@ -1,17 +1,17 @@ cabal-version: 1.18 name: persistent-sql-lifted-version: 0.1.0.0+version: 0.1.1.0 license: MIT license-file: LICENSE maintainer: Freckle Education-homepage: https://github.com/freckle/freckle-app#readme-bug-reports: https://github.com/freckle/freckle-app/issues+homepage: https://github.com/freckle/persistent-sql-lifted#readme+bug-reports: https://github.com/freckle/persistent-sql-lifted/issues synopsis: Monad classes for running queries with Persistent and Esqueleto description: This package introduces two classes: MonadSqlBackend for monadic contexts in- which a SqlBackend is available, and MonadSqlBackend for contexts in which we+ which a SqlBackend is available, and MonadSqlTx for contexts in which we can execute a SQL transaction. . Additionally, this package provides variants of query-running utilities from@@ -28,7 +28,7 @@ source-repository head type: git- location: https://github.com/freckle/freckle-app+ location: https://github.com/freckle/persistent-sql-lifted library exposed-modules: