Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Work with SQLite database used for caches across a single project.
Synopsis
- initProjectStorage :: HasLogFunc env => Path Abs File -> (ProjectStorage -> RIO env a) -> RIO env a
- type ConfigCacheKey = Unique ConfigCacheParent
- configCacheKey :: Path Abs Dir -> ConfigCacheType -> ConfigCacheKey
- loadConfigCache :: (HasBuildConfig env, HasLogFunc env) => ConfigCacheKey -> RIO env (Maybe ConfigCache)
- saveConfigCache :: (HasBuildConfig env, HasLogFunc env) => ConfigCacheKey -> ConfigCache -> RIO env ()
- deactiveConfigCache :: HasBuildConfig env => ConfigCacheKey -> RIO env ()
Documentation
:: HasLogFunc env | |
=> Path Abs File | storage file |
-> (ProjectStorage -> RIO env a) | |
-> RIO env a |
Initialize the database.
type ConfigCacheKey = Unique ConfigCacheParent Source #
Key used to retrieve configuration or flag cache
configCacheKey :: Path Abs Dir -> ConfigCacheType -> ConfigCacheKey Source #
Build key used to retrieve configuration or flag cache
loadConfigCache :: (HasBuildConfig env, HasLogFunc env) => ConfigCacheKey -> RIO env (Maybe ConfigCache) Source #
Load ConfigCache
from the database.
saveConfigCache :: (HasBuildConfig env, HasLogFunc env) => ConfigCacheKey -> ConfigCache -> RIO env () Source #
Insert or update ConfigCache
to the database.
deactiveConfigCache :: HasBuildConfig env => ConfigCacheKey -> RIO env () Source #
Mark ConfigCache
as inactive in the database.
We use a flag instead of deleting the records since, in most cases, the same
cache will be written again within in a few seconds (after
`cabal configure`), so this avoids unnecessary database churn.