Safe Haskell | None |
---|---|
Language | GHC2021 |
Synopsis
- data CliOptions
- data DumpOptions = DumpOptions {}
- data RunOptions = RunOptions {
- disableAll :: Bool
- enableAll :: Bool
- depsOnly :: Bool
- forceTables :: [SpecTableName]
- skipTables :: [SpecTableName]
- naturalUpdates :: [SpecTableName]
- app :: Text
- logLevel :: Maybe Severity
- dryRun :: Bool
- namespace :: Maybe Text
- metadataConnectionString :: Maybe Text
- showProgress :: Bool
- meta :: [ByteString]
- enableTags :: [TableSpecTag]
- disableTags :: [TableSpecTag]
- condensedLogging :: CondensedLogging
- maxConcurrency :: Maybe Natural
- newtype CustomSpecPreprocessor bk = CustomSpecPreprocessor (SpecMetaArgs -> SpecRuntime bk -> Specs bk -> Specs bk)
- parseRunOptions :: Parser CliOptions
- parseDumpOptions :: Parser CliOptions
- parseCliOption :: Parser CliOptions
- parseSpecMetaArgs :: [ByteString] -> Either String SpecMetaArgs
- dumpDeps :: (MustacheBackend bk, RunBackendEffect bk, DumpBackendRequirements bk) => RuntimeEnv -> ExternMacros -> bk -> Spec bk a -> IO ()
- specMain :: SpecBackend bk => bk -> SpecRuntime bk -> Spec bk a -> IO ExitCode
- specMainWith :: SpecBackend bk => (AppConfig -> ResourceT IO (ComboEnv bk)) -> CliOptions -> bk -> CustomSpecPreprocessor bk -> CustomValidator -> ExternMacros -> SpecRuntime bk -> Spec bk a -> IO ExitCode
- specMainWithInterpreter :: SpecBackend bk => RuntimeEnv -> (AppConfig -> ResourceT IO (ComboEnv bk)) -> CliOptions -> bk -> CustomSpecPreprocessor bk -> CustomValidator -> ExternMacros -> SpecRuntime bk -> Spec bk a -> IO ExitCode
- exitRunFailed :: ExitCode
- exitValidationFailed :: ExitCode
- specTagRefMap :: [TableSpec b] -> Map (Maybe TableSpecTag) [SpecTableName]
- specListTags :: (SpecBackend bk, MonadIO m) => Specs bk -> m ()
Documentation
data CliOptions #
Data structure for all CLI command and sub-commands.
Instances
Show CliOptions # | |
Defined in Napkin.Spec.Cli showsPrec :: Int -> CliOptions -> ShowS # show :: CliOptions -> String # showList :: [CliOptions] -> ShowS # | |
Eq CliOptions # | |
Defined in Napkin.Spec.Cli (==) :: CliOptions -> CliOptions -> Bool # (/=) :: CliOptions -> CliOptions -> Bool # |
data DumpOptions #
Data structure dump sub-command.
Instances
data RunOptions #
Data structure run sub-command.
RunOptions | |
|
Instances
Generic RunOptions # | |||||
Defined in Napkin.Spec.Cli
from :: RunOptions -> Rep RunOptions x # to :: Rep RunOptions x -> RunOptions # | |||||
Show RunOptions # | |||||
Defined in Napkin.Spec.Cli showsPrec :: Int -> RunOptions -> ShowS # show :: RunOptions -> String # showList :: [RunOptions] -> ShowS # | |||||
Eq RunOptions # | |||||
Defined in Napkin.Spec.Cli (==) :: RunOptions -> RunOptions -> Bool # (/=) :: RunOptions -> RunOptions -> Bool # | |||||
type Rep RunOptions # | |||||
Defined in Napkin.Spec.Cli type Rep RunOptions = D1 ('MetaData "RunOptions" "Napkin.Spec.Cli" "napkin-1.0.0-5YkWAC9Wc776PT0LDghaFb" 'False) (C1 ('MetaCons "RunOptions" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "disableAll") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "enableAll") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "depsOnly") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "forceTables") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [SpecTableName]))) :*: ((S1 ('MetaSel ('Just "skipTables") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [SpecTableName]) :*: S1 ('MetaSel ('Just "naturalUpdates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [SpecTableName])) :*: (S1 ('MetaSel ('Just "app") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "logLevel") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Severity))))) :*: (((S1 ('MetaSel ('Just "dryRun") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "namespace") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "metadataConnectionString") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "showProgress") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))) :*: ((S1 ('MetaSel ('Just "meta") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ByteString]) :*: S1 ('MetaSel ('Just "enableTags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TableSpecTag])) :*: (S1 ('MetaSel ('Just "disableTags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TableSpecTag]) :*: (S1 ('MetaSel ('Just "condensedLogging") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CondensedLogging) :*: S1 ('MetaSel ('Just "maxConcurrency") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Natural)))))))) |
newtype CustomSpecPreprocessor bk #
User-specified function to preprocess all specs. Useful for renaming all tables, for example, in development vs. production mode.
CustomSpecPreprocessor (SpecMetaArgs -> SpecRuntime bk -> Specs bk -> Specs bk) |
Instances
Default (CustomSpecPreprocessor bk) # | |
Defined in Napkin.Spec.Cli def :: CustomSpecPreprocessor bk # |
parseRunOptions :: Parser CliOptions #
Parser for the run
CLI sub-command
Parses available commands for the run
sub-command and provides detail CLI help text
parseDumpOptions :: Parser CliOptions #
Parser for the dump
CLI sub-command
Parses available commands for the run
sub-command and provides detail CLI help text
parseSpecMetaArgs :: [ByteString] -> Either String SpecMetaArgs #
dumpDeps :: (MustacheBackend bk, RunBackendEffect bk, DumpBackendRequirements bk) => RuntimeEnv -> ExternMacros -> bk -> Spec bk a -> IO () #
specMain :: SpecBackend bk => bk -> SpecRuntime bk -> Spec bk a -> IO ExitCode #
Use this to make your main
entry point for your spec running
application.
specMain :: bk -> [(NS.SpecRuntime bk, NST.Spec bk ())] -> IO ()
:: SpecBackend bk | |
=> (AppConfig -> ResourceT IO (ComboEnv bk)) | How to build the combo. register any cleanup |
-> CliOptions | |
-> bk | |
-> CustomSpecPreprocessor bk | |
-> CustomValidator | |
-> ExternMacros | |
-> SpecRuntime bk | |
-> Spec bk a | |
-> IO ExitCode |
A more customizable specMain for embedding in larger programs. This API is unstable
:: SpecBackend bk | |
=> RuntimeEnv | |
-> (AppConfig -> ResourceT IO (ComboEnv bk)) | How to build the combo. register any cleanup |
-> CliOptions | |
-> bk | |
-> CustomSpecPreprocessor bk | |
-> CustomValidator | |
-> ExternMacros | |
-> SpecRuntime bk | |
-> Spec bk a | |
-> IO ExitCode |
specTagRefMap :: [TableSpec b] -> Map (Maybe TableSpecTag) [SpecTableName] #
create a mapping of TableSpecTag
s to `Ref Table`s for dumping.
specListTags :: (SpecBackend bk, MonadIO m) => Specs bk -> m () #
Print the result of specTagRefMap'ing a particular spec to terminal.