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

Stack.Storage.Project

Description

Work with SQLite database used for caches across a single project.

Synopsis

Documentation

initProjectStorage Source #

Arguments

:: 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

data ConfigCacheParent Source #

Instances

Instances details
Show ConfigCacheParent Source # 
Instance details

Defined in Stack.Storage.Project

PersistEntity ConfigCacheParent Source # 
Instance details

Defined in Stack.Storage.Project

SafeToInsert ConfigCacheParent Source # 
Instance details

Defined in Stack.Storage.Project

PersistField ConfigCacheParent Source # 
Instance details

Defined in Stack.Storage.Project

AtLeastOneUniqueKey ConfigCacheParent Source # 
Instance details

Defined in Stack.Storage.Project

OnlyOneUniqueKey ConfigCacheParent Source # 
Instance details

Defined in Stack.Storage.Project

PersistFieldSql ConfigCacheParent Source # 
Instance details

Defined in Stack.Storage.Project

Methods

sqlType :: Proxy ConfigCacheParent -> SqlType

ToBackendKey SqlBackend ConfigCacheParent Source # 
Instance details

Defined in Stack.Storage.Project

Methods

toBackendKey :: Key ConfigCacheParent -> BackendKey SqlBackend

fromBackendKey :: BackendKey SqlBackend -> Key ConfigCacheParent

SymbolToField "active" ConfigCacheParent Bool Source # 
Instance details

Defined in Stack.Storage.Project

SymbolToField "directory" ConfigCacheParent FilePath Source # 
Instance details

Defined in Stack.Storage.Project

SymbolToField "haddock" ConfigCacheParent Bool Source # 
Instance details

Defined in Stack.Storage.Project

SymbolToField "pathEnvVar" ConfigCacheParent Text Source # 
Instance details

Defined in Stack.Storage.Project

SymbolToField "pkgSrc" ConfigCacheParent CachePkgSrc Source # 
Instance details

Defined in Stack.Storage.Project

SymbolToField "type" ConfigCacheParent ConfigCacheType Source # 
Instance details

Defined in Stack.Storage.Project

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

Defined in Stack.Storage.Project

FromJSON (Key ConfigCacheParent) Source # 
Instance details

Defined in Stack.Storage.Project

ToJSON (Key ConfigCacheParent) Source # 
Instance details

Defined in Stack.Storage.Project

Read (Key ConfigCacheParent) Source # 
Instance details

Defined in Stack.Storage.Project

Show (Key ConfigCacheParent) Source # 
Instance details

Defined in Stack.Storage.Project

Eq (Key ConfigCacheParent) Source # 
Instance details

Defined in Stack.Storage.Project

Ord (Key ConfigCacheParent) Source # 
Instance details

Defined in Stack.Storage.Project

FromHttpApiData (Key ConfigCacheParent) Source # 
Instance details

Defined in Stack.Storage.Project

ToHttpApiData (Key ConfigCacheParent) Source # 
Instance details

Defined in Stack.Storage.Project

PathPiece (Key ConfigCacheParent) Source # 
Instance details

Defined in Stack.Storage.Project

PersistField (Key ConfigCacheParent) Source # 
Instance details

Defined in Stack.Storage.Project

PersistFieldSql (Key ConfigCacheParent) Source # 
Instance details

Defined in Stack.Storage.Project

Methods

sqlType :: Proxy (Key ConfigCacheParent) -> SqlType

data EntityField ConfigCacheParent typ Source # 
Instance details

Defined in Stack.Storage.Project

newtype Key ConfigCacheParent Source # 
Instance details

Defined in Stack.Storage.Project

type PersistEntityBackend ConfigCacheParent Source # 
Instance details

Defined in Stack.Storage.Project

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

Defined in Stack.Storage.Project

configCacheKey :: Path Abs Dir -> ConfigCacheType -> ConfigCacheKey Source #

Build key used to retrieve configuration or flag cache

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.