Represents a value containing all the configuration options for a specific backend. This abstraction makes it easier to write code that can easily swap backends.
Associated types
type family PersistConfigBackend c :: (Type -> Type) -> Type -> Typetype family PersistConfigPool c
Methods
loadConfig :: Value -> Parser cLoad the config settings from a Value, most likely taken from a YAML config file.
applyEnv :: c -> IO cModify the config settings based on environment variables.
createPoolConfig :: c -> IO (PersistConfigPool c)Create a new connection pool based on the given config settings.
runPool :: MonadUnliftIO m => c -> PersistConfigBackend c m a -> PersistConfigPool c -> m aRun a database action by taking a connection from the pool.
Instances1PersistConfig
(PersistConfig c1, PersistConfig c2, PersistConfigPool c1 ~ PersistConfigPool c2, PersistConfigBackend c1 ~ PersistConfigBackend c2) => PersistConfig (Either c1 c2)Defined in persistent-2.14.6.3 · Database.Persist.Class.PersistConfig