persistent-2.13.3.5: Type-safe, multi-backend data serialization.
Safe Haskell None
Language Haskell2010

Database.Persist.Class.PersistConfig

Synopsis

Documentation

class PersistConfig c where Source #

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.

Minimal complete definition

loadConfig , createPoolConfig , runPool

Methods

loadConfig :: Value -> Parser c Source #

Load the config settings from a Value , most likely taken from a YAML config file.

applyEnv :: c -> IO c Source #

Modify the config settings based on environment variables.

createPoolConfig :: c -> IO ( PersistConfigPool c) Source #

Create a new connection pool based on the given config settings.

runPool :: MonadUnliftIO m => c -> PersistConfigBackend c m a -> PersistConfigPool c -> m a Source #

Run a database action by taking a connection from the pool.