stack-3.7.1: The Haskell Tool Stack
LicenseBSD-3-Clause
Safe HaskellNone
LanguageGHC2021

Stack.Storage.User

Description

Work with SQLite database used for caches across an entire user account.

Synopsis

Documentation

initUserStorage Source #

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

data PrecompiledCacheParent Source #

Instances

Instances details
Show PrecompiledCacheParent Source # 
Instance details

Defined in Stack.Storage.User

PersistEntity PrecompiledCacheParent Source # 
Instance details

Defined in Stack.Storage.User

SafeToInsert PrecompiledCacheParent Source # 
Instance details

Defined in Stack.Storage.User

PersistField PrecompiledCacheParent Source # 
Instance details

Defined in Stack.Storage.User

AtLeastOneUniqueKey PrecompiledCacheParent Source # 
Instance details

Defined in Stack.Storage.User

OnlyOneUniqueKey PrecompiledCacheParent Source # 
Instance details

Defined in Stack.Storage.User

PersistFieldSql PrecompiledCacheParent Source # 
Instance details

Defined in Stack.Storage.User

Methods

sqlType :: Proxy PrecompiledCacheParent -> SqlType

ToBackendKey SqlBackend PrecompiledCacheParent Source # 
Instance details

Defined in Stack.Storage.User

Methods

toBackendKey :: Key PrecompiledCacheParent -> BackendKey SqlBackend

fromBackendKey :: BackendKey SqlBackend -> Key PrecompiledCacheParent

SymbolToField "cabalVersion" PrecompiledCacheParent Text Source # 
Instance details

Defined in Stack.Storage.User

SymbolToField "compiler" PrecompiledCacheParent Text Source # 
Instance details

Defined in Stack.Storage.User

SymbolToField "haddock" PrecompiledCacheParent Bool Source # 
Instance details

Defined in Stack.Storage.User

SymbolToField "optionsHash" PrecompiledCacheParent ByteString Source # 
Instance details

Defined in Stack.Storage.User

SymbolToField "packageKey" PrecompiledCacheParent Text Source # 
Instance details

Defined in Stack.Storage.User

SymbolToField "platformGhcDir" PrecompiledCacheParent FilePath Source # 
Instance details

Defined in Stack.Storage.User

SymbolToField "id" PrecompiledCacheParent (Key PrecompiledCacheParent) Source # 
Instance details

Defined in Stack.Storage.User

SymbolToField "library" PrecompiledCacheParent (Maybe FilePath) Source # 
Instance details

Defined in Stack.Storage.User

FromJSON (Key PrecompiledCacheParent) Source # 
Instance details

Defined in Stack.Storage.User

ToJSON (Key PrecompiledCacheParent) Source # 
Instance details

Defined in Stack.Storage.User

Read (Key PrecompiledCacheParent) Source # 
Instance details

Defined in Stack.Storage.User

Show (Key PrecompiledCacheParent) Source # 
Instance details

Defined in Stack.Storage.User

Eq (Key PrecompiledCacheParent) Source # 
Instance details

Defined in Stack.Storage.User

Ord (Key PrecompiledCacheParent) Source # 
Instance details

Defined in Stack.Storage.User

FromHttpApiData (Key PrecompiledCacheParent) Source # 
Instance details

Defined in Stack.Storage.User

ToHttpApiData (Key PrecompiledCacheParent) Source # 
Instance details

Defined in Stack.Storage.User

PathPiece (Key PrecompiledCacheParent) Source # 
Instance details

Defined in Stack.Storage.User

PersistField (Key PrecompiledCacheParent) Source # 
Instance details

Defined in Stack.Storage.User

PersistFieldSql (Key PrecompiledCacheParent) Source # 
Instance details

Defined in Stack.Storage.User

Methods

sqlType :: Proxy (Key PrecompiledCacheParent) -> SqlType

data EntityField PrecompiledCacheParent typ Source # 
Instance details

Defined in Stack.Storage.User

newtype Key PrecompiledCacheParent Source # 
Instance details

Defined in Stack.Storage.User

type PersistEntityBackend PrecompiledCacheParent Source # 
Instance details

Defined in Stack.Storage.User

type PersistEntityBackend PrecompiledCacheParent = SqlBackend
data Unique PrecompiledCacheParent Source # 
Instance details

Defined in Stack.Storage.User

precompiledCacheKey :: Path Rel Dir -> ActualCompiler -> Version -> Text -> ByteString -> Bool -> PrecompiledCacheKey Source #

Build key used to retrieve the precompiled cache

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

loadCompilerPaths Source #

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!

upgradeChecksSince :: HasConfig env => UTCTime -> RIO env Int Source #

How many upgrade checks have occurred since the given timestamp?

logUpgradeCheck :: HasConfig env => UTCTime -> RIO env () Source #

Log in the database that an upgrade check occurred at the given time.