Safe Haskell | None |
---|---|
Language | Haskell2010 |
Work with SQLite database used for caches.
Synopsis
- initStorage :: HasLogFunc env => Path Abs File -> (Storage -> RIO env a) -> RIO env a
- withStorage :: (HasConfig env, HasLogFunc env) => ReaderT SqlBackend (RIO env) a -> RIO env a
- type ConfigCacheKey = Unique ConfigCacheParent
- configCacheKey :: Path Abs Dir -> ConfigCacheType -> ConfigCacheKey
- loadConfigCache :: (HasConfig env, HasLogFunc env) => ConfigCacheKey -> RIO env (Maybe ConfigCache)
- saveConfigCache :: (HasConfig env, HasLogFunc env) => ConfigCacheKey -> ConfigCache -> RIO env ()
- deactiveConfigCache :: HasConfig env => ConfigCacheKey -> RIO env ()
- type PrecompiledCacheKey = Unique PrecompiledCacheParent
- precompiledCacheKey :: Path Rel Dir -> ActualCompiler -> Version -> Text -> ByteString -> Bool -> PrecompiledCacheKey
- loadPrecompiledCache :: (HasConfig env, HasLogFunc env) => PrecompiledCacheKey -> RIO env (Maybe (PrecompiledCache Rel))
- savePrecompiledCache :: (HasConfig env, HasLogFunc env) => PrecompiledCacheKey -> PrecompiledCache Rel -> RIO env ()
- loadDockerImageExeCache :: (HasConfig env, HasLogFunc env) => Text -> Path Abs File -> UTCTime -> RIO env (Maybe Bool)
- saveDockerImageExeCache :: (HasConfig env, HasLogFunc env) => Text -> Path Abs File -> UTCTime -> Bool -> RIO env ()
- loadCompilerPaths :: HasConfig env => Path Abs File -> CompilerBuild -> Bool -> RIO env (Maybe CompilerPaths)
- saveCompilerPaths :: HasConfig env => CompilerPaths -> RIO env ()
- upgradeChecksSince :: HasConfig env => UTCTime -> RIO env Int
- logUpgradeCheck :: HasConfig env => UTCTime -> RIO env ()
Documentation
Initialize the database.
withStorage :: (HasConfig env, HasLogFunc env) => ReaderT SqlBackend (RIO env) a -> RIO env a Source #
Run an action in a database transaction
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 :: (HasConfig env, HasLogFunc env) => ConfigCacheKey -> RIO env (Maybe ConfigCache) Source #
Load ConfigCache
from the database.
saveConfigCache :: (HasConfig env, HasLogFunc env) => ConfigCacheKey -> ConfigCache -> RIO env () Source #
Insert or update ConfigCache
to the database.
deactiveConfigCache :: HasConfig 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.
type PrecompiledCacheKey = Unique PrecompiledCacheParent Source #
Key used to retrieve the precompiled cache
precompiledCacheKey :: Path Rel Dir -> ActualCompiler -> Version -> Text -> ByteString -> Bool -> PrecompiledCacheKey Source #
Build key used to retrieve the precompiled cache
loadPrecompiledCache :: (HasConfig env, HasLogFunc env) => PrecompiledCacheKey -> RIO env (Maybe (PrecompiledCache Rel)) Source #
Load PrecompiledCache
from the database.
savePrecompiledCache :: (HasConfig env, HasLogFunc env) => PrecompiledCacheKey -> PrecompiledCache Rel -> RIO env () Source #
Insert or update PrecompiledCache
to the database.
loadDockerImageExeCache :: (HasConfig env, HasLogFunc env) => Text -> Path Abs File -> UTCTime -> RIO env (Maybe Bool) Source #
Get the record of whether an executable is compatible with a Docker image
saveDockerImageExeCache :: (HasConfig env, HasLogFunc env) => Text -> Path Abs File -> UTCTime -> Bool -> RIO env () Source #
Sest the record of whether an executable is compatible with a Docker image
:: HasConfig env | |
=> Path Abs File | compiler executable |
-> CompilerBuild | |
-> Bool | sandboxed? |
-> RIO env (Maybe CompilerPaths) |
Load compiler information, if available, and confirm that the referenced files are unchanged. May throw exceptions!
saveCompilerPaths :: HasConfig env => CompilerPaths -> RIO env () Source #
Save compiler information. May throw exceptions!