Safe Haskell | None |
---|---|
Language | Haskell2010 |
Arg and Env Parsing for initialisation of the engine along with corresponding logging and other helper functionality.
This module is intended as the interface for options parsing and its submodules should not need to be imported directly.
Synopsis
- getDbId :: TxE QErr MetadataDbId
- getPgVersion :: TxE QErr PGVersion
- mkHGEOptions :: EnabledLogTypes impl => HGEOptionsRaw (ServeOptionsRaw impl) -> WithEnv (HGEOptions (ServeOptions impl))
- processPostgresConnInfo :: PostgresConnInfo (Maybe PostgresConnInfoRaw) -> WithEnv (PostgresConnInfo (Maybe UrlConf))
- rawConnInfoToUrlConf :: Maybe PostgresConnInfoRaw -> WithEnv (Maybe UrlConf)
- mkServeOptions :: forall impl. EnabledLogTypes impl => ServeOptionsRaw impl -> WithEnv (ServeOptions impl)
Documentation
getDbId :: TxE QErr MetadataDbId Source #
Query the Metadata DB for the Metadata DB UUID. TODO: Move into a dedicated Metadata module (ala Pro).
getPgVersion :: TxE QErr PGVersion Source #
mkHGEOptions :: EnabledLogTypes impl => HGEOptionsRaw (ServeOptionsRaw impl) -> WithEnv (HGEOptions (ServeOptions impl)) Source #
Given the ServeOptionsRaw
parsed from the arg parser,
postprocess the db url and fetch env vars associated with the main
command parser, then process the subcommand raw values if
necessary.
processPostgresConnInfo :: PostgresConnInfo (Maybe PostgresConnInfoRaw) -> WithEnv (PostgresConnInfo (Maybe UrlConf)) Source #
PostressConnInfo
is a a tuple of some a
with a 'Maybe Int'
representing the retries setting. This function thus takes a
retries setting and a PostgresConnInfoRaw
from the arg parser and
merges those results with the contents of their corresponding env
vars.
rawConnInfoToUrlConf :: Maybe PostgresConnInfoRaw -> WithEnv (Maybe UrlConf) Source #
A helper function for processPostgresConnInfo
which fetches
postgres connection info from the WithEnv
and merges it with the
arg parser result.
mkServeOptions :: forall impl. EnabledLogTypes impl => ServeOptionsRaw impl -> WithEnv (ServeOptions impl) Source #
Merge the results of the serve subcommmand arg parser with
corresponding values from the WithEnv
context.