| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Stack.Storage.User
Description
Work with SQLite database used for caches across an entire user account.
Synopsis
- initUserStorage :: HasLogFunc env => Path Abs File -> (UserStorage -> RIO env a) -> RIO env a
- 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
Arguments
| :: HasLogFunc env | |
| => Path Abs File | storage file |
| -> (UserStorage -> RIO env a) | |
| -> RIO env a |
Initialize the database.
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 #
Sets the record of whether an executable is compatible with a Docker image
Arguments
| :: 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!