diff --git a/ChangeLog.md b/ChangeLog.md index 0b81166a..9f714e2a 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,9 @@ # Changelog for pantry +## v0.9.1 + +* Expose module `Pantry.SQLite`. + ## v0.9.0 * Remove module `Pantry.Internal.AesonExtended` and depend on diff --git a/int/Pantry/Types.hs b/int/Pantry/Types.hs index 942f201e..d78b0504 100644 --- a/int/Pantry/Types.hs +++ b/int/Pantry/Types.hs @@ -260,12 +260,13 @@ cabalFileName name = newtype Revision = Revision Word deriving (Generic, Show, Eq, NFData, Data, Typeable, Ord, Hashable, Display, PersistField, PersistFieldSql) --- | Represents a SQL database connection. This used to be a newtype wrapper --- around a connection pool. However, when investigating --- , it appeared that --- holding a pool resulted in overly long write locks being held on the --- database. As a result, we now abstract away whether a pool is used, and the --- default implementation in "Pantry.Storage" does not use a pool. +-- | Represents a SQL database connection. + +-- This used to be a newtype wrapper around a connection pool. However, when +-- investigating , it +-- appeared that holding a pool resulted in overly long write locks being held +-- on the database. As a result, we now abstract away whether a pool is used, +-- and the default implementation in "Pantry.Storage" does not use a pool. data Storage = Storage { withStorage_ :: forall env a. HasLogFunc env diff --git a/package.yaml b/package.yaml index e7164c43..3706da19 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: pantry -version: 0.9.0 +version: 0.9.1 synopsis: Content addressable Haskell package management description: Please see the README on GitHub at category: Development @@ -99,8 +99,9 @@ library: exposed-modules: - Pantry + - Pantry.SQLite - # For stackage-server + # For stackage-server, and stack testing - Pantry.Internal.Stackage reexported-modules: diff --git a/pantry.cabal b/pantry.cabal index 0a40b827..163102f6 100644 --- a/pantry.cabal +++ b/pantry.cabal @@ -5,7 +5,7 @@ cabal-version: 2.0 -- see: https://github.com/sol/hpack name: pantry -version: 0.9.0 +version: 0.9.1 synopsis: Content addressable Haskell package management description: Please see the README on GitHub at category: Development @@ -36,6 +36,7 @@ flag test-pretty-exceptions library exposed-modules: Pantry + Pantry.SQLite Pantry.Internal.Stackage other-modules: Hackage.Security.Client.Repository.HttpLib.HttpClient @@ -122,7 +123,6 @@ library internal Pantry.HPack Pantry.Internal Pantry.SHA256 - Pantry.SQLite Pantry.Types other-modules: Paths_pantry diff --git a/src/Pantry/Internal/Stackage.hs b/src/Pantry/Internal/Stackage.hs index 5f74f96c..9e9237be 100644 --- a/src/Pantry/Internal/Stackage.hs +++ b/src/Pantry/Internal/Stackage.hs @@ -1,5 +1,6 @@ -- | All types and functions exported from this module are for advanced usage --- only. They are needed for stackage-server integration with pantry. +-- only. They are needed for stackage-server integration with pantry and some +-- are needed for stack testing. module Pantry.Internal.Stackage ( module X ) where diff --git a/int/Pantry/SQLite.hs b/src/Pantry/SQLite.hs similarity index 94% rename from int/Pantry/SQLite.hs rename to src/Pantry/SQLite.hs index 6c19badc..2956ff16 100644 --- a/int/Pantry/SQLite.hs +++ b/src/Pantry/SQLite.hs @@ -22,10 +22,10 @@ import System.FileLock initStorage :: HasLogFunc env - => Text - -> Migration - -> Path Abs File -- ^ storage file - -> (Storage -> RIO env a) + => Text -- ^ Database description, for lock messages. + -> Migration -- ^ Initial migration. + -> Path Abs File -- ^ SQLite database file. + -> (Storage -> RIO env a) -- ^ What to do with the initialised 'Storage'. -> RIO env a initStorage description migration fp inner = do ensureDir $ parent fp @@ -76,7 +76,7 @@ initStorage description migration fp inner = do -- above. withWriteLock :: HasLogFunc env - => Utf8Builder -- ^ database description, for lock messages + => Utf8Builder -- ^ Database description, for lock messages -> Path Abs File -- ^ SQLite database file -> RIO env a -> RIO env a