| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Database.Postgres.Temp.Config
Contents
Description
This module provides types and functions for combining partial
configs into a complete configs to ultimately make a CompletePlan.
This module has two classes of types.
Types like ProcessConfig that could be used by any
library that needs to combine process options.
Finally it has types and functions for creating CompletePlans that
use temporary resources. This is used to create the default
behavior of startConfig and related
functions.
|
Synopsis
- data Config = Config {
- plan :: Plan
- socketDirectory :: DirectoryType
- dataDirectory :: DirectoryType
- port :: Last (Maybe Int)
- temporaryDirectory :: Last FilePath
- initDbCache :: Last (Maybe (Bool, FilePath))
- prettyPrintConfig :: Config -> String
- planL :: Lens' Config Plan
- socketDirectoryL :: Lens' Config DirectoryType
- dataDirectoryL :: Lens' Config DirectoryType
- portL :: Lens' Config (Last (Maybe Int))
- connectionTimeoutL :: Lens' Plan (Last Int)
- data Plan = Plan {}
- postgresConfigFileL :: Lens' Plan [String]
- createDbConfigL :: Lens' Plan (Maybe ProcessConfig)
- dataDirectoryStringL :: Lens' Plan (Last String)
- initDbConfigL :: Lens' Plan (Maybe ProcessConfig)
- loggerL :: Lens' Plan (Last Logger)
- postgresPlanL :: Lens' Plan PostgresPlan
- data PostgresPlan = PostgresPlan {}
- connectionOptionsL :: Lens' PostgresPlan Options
- postgresConfigL :: Lens' PostgresPlan ProcessConfig
- data ProcessConfig = ProcessConfig {}
- commandLineL :: Lens' ProcessConfig CommandLineArgs
- environmentVariablesL :: Lens' ProcessConfig EnvironmentVariables
- stdErrL :: Lens' ProcessConfig (Last Handle)
- stdInL :: Lens' ProcessConfig (Last Handle)
- stdOutL :: Lens' ProcessConfig (Last Handle)
- data EnvironmentVariables = EnvironmentVariables {}
- inheritL :: Lens' EnvironmentVariables (Last Bool)
- specificL :: Lens' EnvironmentVariables (Map String String)
- data CommandLineArgs = CommandLineArgs {}
- indexBasedL :: Lens' CommandLineArgs (Map Int String)
- keyBasedL :: Lens' CommandLineArgs (Map String (Maybe String))
- data DirectoryType
- type Logger = Event -> IO ()
- data Event
Documentation
The high level options for overriding default behavior.
Since: 1.15.0.0
Constructors
| Config | |
Fields
| |
Instances
Config Lenses
socketDirectoryL :: Lens' Config DirectoryType Source #
Lens for socketDirectory.
Since: 1.12.0.0
dataDirectoryL :: Lens' Config DirectoryType Source #
Lens for dataDirectory.
Since: 1.12.0.0
connectionTimeoutL :: Lens' Plan (Last Int) Source #
Lens for connectionTimeout.
Since: 1.12.0.0
Plan
Describe how to run initdb, createdb and postgres
Since: 1.12.0.0
Constructors
| Plan | |
Fields
| |
Instances
Plan lenses
postgresConfigFileL :: Lens' Plan [String] Source #
Lens for postgresConfigFile.
Since: 1.12.0.0
createDbConfigL :: Lens' Plan (Maybe ProcessConfig) Source #
Lens for createDbConfig.
Since: 1.12.0.0
dataDirectoryStringL :: Lens' Plan (Last String) Source #
Lens for dataDirectoryString.
Since: 1.12.0.0
initDbConfigL :: Lens' Plan (Maybe ProcessConfig) Source #
Lens for initDbConfig.
Since: 1.12.0.0
postgresPlanL :: Lens' Plan PostgresPlan Source #
Lens for postgresPlan.
Since: 1.12.0.0
PostgresPlan
data PostgresPlan Source #
postgres process config and corresponding client connection
Options.
Since: 1.12.0.0
Constructors
| PostgresPlan | |
Fields
| |
Instances
PostgresPlan lenses
connectionOptionsL :: Lens' PostgresPlan Options Source #
Lens for connectionOptions.
Since: 1.12.0.0
postgresConfigL :: Lens' PostgresPlan ProcessConfig Source #
Lens for postgresConfig.
Since: 1.12.0.0
ProcessConfig
data ProcessConfig Source #
Process configuration
Since: 1.12.0.0
Constructors
| ProcessConfig | |
Fields
| |
Instances
ProcessConfig Lenses
commandLineL :: Lens' ProcessConfig CommandLineArgs Source #
Lens for commandLine.
Since: 1.12.0.0
environmentVariablesL :: Lens' ProcessConfig EnvironmentVariables Source #
Lens for environmentVariables.
Since: 1.12.0.0
EnvironmentVariables
data EnvironmentVariables Source #
The environment variables can be declared to inherit from the running process or they can be specifically added.
Since: 1.12.0.0
Instances
EnvironmentVariables Lenses
specificL :: Lens' EnvironmentVariables (Map String String) Source #
Lens for specific.
Since: 1.12.0.0
CommandLineArgs
data CommandLineArgs Source #
A type to help combine command line Args.
Since: 1.12.0.0
Constructors
| CommandLineArgs | |
Fields | |
Instances
CommandLineArgs Lenses
indexBasedL :: Lens' CommandLineArgs (Map Int String) Source #
Lens for indexBased.
Since: 1.12.0.0
keyBasedL :: Lens' CommandLineArgs (Map String (Maybe String)) Source #
Lens for keyBased.
Since: 1.12.0.0
DirectoryType
data DirectoryType Source #
Used to specify a Temporary folder that is automatically
cleaned up or a Permanent folder which is not
automatically cleaned up.
Since: 1.12.0.0
Constructors
| Permanent FilePath | A permanent file that should not be generated. |
| Temporary | A temporary file that needs to generated. |
Instances
Logger
Internal events passed to the logger .
Internal events for debugging
Since: 1.12.0.0
Constructors
| StartPlan String | The first event. This useful for debugging
what is actual passed to the |
| StartPostgres | The second event. Postgres is about to get called |
| WaitForDB | The third event. Postgres started. We are now about to setup a reconnect loop (racing with a process checker) |
| TryToConnect | The fourth event and (possibly all subsequent events).
We are looping trying to successfully connect to the |