hpqtypes-extras 1.16.3.0 → 1.16.3.1
raw patch · 6 files changed
+17/−10 lines, 6 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Database.PostgreSQL.PQTypes.Deriving: instance (Database.PostgreSQL.PQTypes.Deriving.EnumEncoding a, Database.PostgreSQL.PQTypes.Format.PQFormat (Database.PostgreSQL.PQTypes.Deriving.EnumBase a), Database.PostgreSQL.PQTypes.FromSQL.FromSQL (Database.PostgreSQL.PQTypes.Deriving.EnumBase a), GHC.Show.Show (Database.PostgreSQL.PQTypes.Deriving.EnumBase a), Data.Typeable.Internal.Typeable (Database.PostgreSQL.PQTypes.Deriving.EnumBase a)) => Database.PostgreSQL.PQTypes.FromSQL.FromSQL (Database.PostgreSQL.PQTypes.Deriving.SQLEnum a)
+ Database.PostgreSQL.PQTypes.Deriving: instance (Database.PostgreSQL.PQTypes.Deriving.EnumEncoding a, Foreign.Storable.Storable (Database.PostgreSQL.PQTypes.FromSQL.PQBase (Database.PostgreSQL.PQTypes.Deriving.EnumBase a)), Database.PostgreSQL.PQTypes.Format.PQFormat (Database.PostgreSQL.PQTypes.Deriving.EnumBase a), Database.PostgreSQL.PQTypes.FromSQL.FromSQL (Database.PostgreSQL.PQTypes.Deriving.EnumBase a), GHC.Show.Show (Database.PostgreSQL.PQTypes.Deriving.EnumBase a), Data.Typeable.Internal.Typeable (Database.PostgreSQL.PQTypes.Deriving.EnumBase a)) => Database.PostgreSQL.PQTypes.FromSQL.FromSQL (Database.PostgreSQL.PQTypes.Deriving.SQLEnum a)
Files
- CHANGELOG.md +5/−1
- hpqtypes-extras.cabal +2/−2
- src/Database/PostgreSQL/PQTypes/Checks.hs +2/−1
- src/Database/PostgreSQL/PQTypes/Deriving.hs +2/−0
- src/Database/PostgreSQL/PQTypes/Model/Migration.hs +5/−5
- src/Database/PostgreSQL/PQTypes/SQL/Builder.hs +1/−1
CHANGELOG.md view
@@ -1,3 +1,7 @@+# hpqtypes-extras-1.16.3.1 (2023-04-13)+* Add support for GHC 9.6.+* Fix checkAndRememberMaterializationSupport's query.+ # hpqtypes-extras-1.16.3.0 (2023-01-25) * Add support for `WITH MATERIALIZED` with backward compatibility. * Add `sqlWhereEqualsAny`.@@ -37,7 +41,7 @@ # hpqtypes-extras-1.12.0.1 (2021-10-11) * Add support for log-base-0.11.0.0 -# hpqtypes-extras-1.12.0.0 (2021-10-??)+# hpqtypes-extras-1.12.0.0 (2021-09-29) * Use plain exceptions instead of DBExtraException # hpqtypes-extras-1.11.0.0 (2021-03-29)
hpqtypes-extras.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: hpqtypes-extras-version: 1.16.3.0+version: 1.16.3.1 synopsis: Extra utilities for hpqtypes library description: The following extras for hpqtypes library: .@@ -20,7 +20,7 @@ copyright: Scrive AB category: Database build-type: Simple-tested-with: GHC ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.4 || ==9.4.2+tested-with: GHC ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.7 || ==9.4.4 || ==9.6.1 Source-repository head Type: git
src/Database/PostgreSQL/PQTypes/Checks.hs view
@@ -15,10 +15,11 @@ import Control.Arrow ((&&&)) import Control.Concurrent (threadDelay)+import Control.Monad import Control.Monad.Catch import Control.Monad.Reader import Data.Int-import Data.Function (on)+import Data.Function import Data.List (partition) import Data.Maybe import Data.Monoid.Utils
src/Database/PostgreSQL/PQTypes/Deriving.hs view
@@ -15,6 +15,7 @@ import Data.Text (Text) import Data.Typeable import Database.PostgreSQL.PQTypes+import Foreign.Storable import qualified Data.Map.Strict as Map -- | Helper newtype to be used with @deriving via@ to derive @(PQFormat, ToSQL,@@ -93,6 +94,7 @@ instance ( EnumEncoding a+ , Storable (PQBase (EnumBase a)) , PQFormat (EnumBase a) , FromSQL (EnumBase a) , Show (EnumBase a)
src/Database/PostgreSQL/PQTypes/Model/Migration.hs view
@@ -64,13 +64,13 @@ -- Name of the table that the cursor is associated with. It has to be the same as in the -- cursor SQL, see the second parameter. --- -- SQL that will be used for the cursor.+ -- SQL providing a list of primary keys from the associated table that will be used for the cursor. --- -- Function that takes a list of primary keys provided by the cursor SQL and- -- runs an arbitrary computation within MonadDB. The function might be called- -- repeatedly depending on the number of primary keys. See the last argument.+ -- Function that takes a batch of primary keys provided by the cursor SQL and runs an arbitrary computation+ -- within MonadDB. The function might be called repeatedly depending on the batch size and total number of+ -- selected primary keys. See the last argument. --- -- Number of primary keys fetched at once by the cursor SQL.+ -- Batch size of primary keys to be fetched at once by the cursor SQL and be given to the modification function. -- To handle multi-column primary keys, the following needs to be done: -- -- 1. Get the list of tuples from PostgreSQL.
src/Database/PostgreSQL/PQTypes/SQL/Builder.hs view
@@ -423,7 +423,7 @@ checkAndRememberMaterializationSupport :: (MonadDB m, MonadIO m, MonadMask m) => m () checkAndRememberMaterializationSupport = do res :: Either DBException Int64 <- try . withNewConnection $ do- runSQL01_ $ "WITH t(n) AS MATERIALIZED (SELECT 1) SELECT n FROM t LIMIT 1"+ runSQL01_ $ "WITH t(n) AS MATERIALIZED (SELECT (1 :: bigint)) SELECT n FROM t LIMIT 1" fetchOne runIdentity liftIO $ writeIORef withMaterializedSupported (isRight res)