| 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 {}
- prettyPrintConfig :: Config -> String
- planL :: Lens' Config Plan
- socketClassL :: Lens' Config SocketClass
- 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
- data SocketClass
- type Logger = Event -> IO ()
- data Event
Documentation
The high level options for overriding default behavior.
Since: 1.12.0.0
Constructors
| Config | |
| Fields 
 | |
Instances
| Generic Config Source # | |
| Semigroup Config Source # | |
| Monoid Config Source # | |
| Pretty Config Source # | |
| Defined in Database.Postgres.Temp.Internal.Config | |
| type Rep Config Source # | |
| Defined in Database.Postgres.Temp.Internal.Config type Rep Config = D1 (MetaData "Config" "Database.Postgres.Temp.Internal.Config" "tmp-postgres-1.12.0.1-FTAVbBlb28U6ckdd2KgA0P" False) (C1 (MetaCons "Config" PrefixI True) ((S1 (MetaSel (Just "plan") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Plan) :*: S1 (MetaSel (Just "socketClass") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 SocketClass)) :*: (S1 (MetaSel (Just "dataDirectory") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DirectoryType) :*: (S1 (MetaSel (Just "port") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last (Maybe Int))) :*: S1 (MetaSel (Just "temporaryDirectory") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last FilePath)))))) | |
Config Lenses
socketClassL :: Lens' Config SocketClass Source #
Lens for socketClass.
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
SocketClass
data SocketClass Source #
SocketClass is used to specify how postgres should listen for connections
   The two main options are a IpSocket which takes a hostname or IP address.
   if not is given the default it "127.0.0.1". Alternatively one can
   specify UnixSocket for a UNIX domain socket. If a directory is
   specified the socket will live in that folder. Otherwise a
   temporary folder will get created for the socket.
Since: 1.12.0.0
Constructors
| IpSocket (Last String) | The monoid for combining IP address configuration. | 
| UnixSocket DirectoryType | The monoid for combining UNIX socket configuration. | 
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  |