| License | BSD-3-Clause |
|---|---|
| Safe Haskell | None |
| Language | GHC2024 |
Stack.Storage.Project
Description
Work with the SQLite database used for a project's caches.
Synopsis
- initProjectStorage :: HasLogFunc env => Path Abs File -> (ProjectStorage -> RIO env a) -> RIO env a
- type ConfigCacheKey = Unique ConfigCacheParent
- data ConfigCacheParent = ConfigCacheParent {}
- type ConfigCacheParentId = Key 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
Arguments
| :: HasLogFunc env | |
| => Path Abs File | The storage file. |
| -> (ProjectStorage -> RIO env a) | Action, given a SQL database connection to the project database for caches. |
| -> RIO env a |
Initialize the project database for caches.
type ConfigCacheKey = Unique ConfigCacheParent Source #
Type synonym representing keys used to retrieve a record from the Cabal configuration cache or the library or executable Cabal flag cache.
data ConfigCacheParent Source #
Constructors
| ConfigCacheParent | |
Instances
Arguments
| :: Path Abs Dir | Directory. |
| -> ConfigCacheType | Type of cache. |
| -> ConfigCacheKey |
For the given directory and type of cache, yields the key used to retrieve a record from the Cabal configuration cache or the library or executable Cabal flag cache.
loadConfigCache :: (HasBuildConfig env, HasLogFunc env) => ConfigCacheKey -> RIO env (Maybe ConfigCache) Source #
Load a ConfigCache value from the project database for caches.
saveConfigCache :: (HasBuildConfig env, HasLogFunc env) => ConfigCacheKey -> ConfigCache -> RIO env () Source #
Insert or update a ConfigCache value to the project database for caches.
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.