napkin-1.0.0
Safe HaskellNone
LanguageGHC2021

Napkin.Spec.Cli

Synopsis

Documentation

data CliOptions #

Data structure for all CLI command and sub-commands.

Instances

Instances details
Show CliOptions # 
Instance details

Defined in Napkin.Spec.Cli

Eq CliOptions # 
Instance details

Defined in Napkin.Spec.Cli

data DumpOptions #

Data structure dump sub-command.

Instances

Instances details
Generic DumpOptions # 
Instance details

Defined in Napkin.Spec.Cli

Associated Types

type Rep DumpOptions 
Instance details

Defined in Napkin.Spec.Cli

type Rep DumpOptions = D1 ('MetaData "DumpOptions" "Napkin.Spec.Cli" "napkin-1.0.0-5YkWAC9Wc776PT0LDghaFb" 'False) (C1 ('MetaCons "DumpOptions" 'PrefixI 'True) (S1 ('MetaSel ('Just "outputDirectory") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: (S1 ('MetaSel ('Just "meta") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ByteString]) :*: S1 ('MetaSel ('Just "excludeUnmanagedTables") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))
Show DumpOptions # 
Instance details

Defined in Napkin.Spec.Cli

Eq DumpOptions # 
Instance details

Defined in Napkin.Spec.Cli

type Rep DumpOptions # 
Instance details

Defined in Napkin.Spec.Cli

type Rep DumpOptions = D1 ('MetaData "DumpOptions" "Napkin.Spec.Cli" "napkin-1.0.0-5YkWAC9Wc776PT0LDghaFb" 'False) (C1 ('MetaCons "DumpOptions" 'PrefixI 'True) (S1 ('MetaSel ('Just "outputDirectory") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: (S1 ('MetaSel ('Just "meta") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ByteString]) :*: S1 ('MetaSel ('Just "excludeUnmanagedTables") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))

data RunOptions #

Data structure run sub-command.

Instances

Instances details
Generic RunOptions # 
Instance details

Defined in Napkin.Spec.Cli

Associated Types

type Rep RunOptions 
Instance details

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))))))))
Show RunOptions # 
Instance details

Defined in Napkin.Spec.Cli

Eq RunOptions # 
Instance details

Defined in Napkin.Spec.Cli

type Rep RunOptions # 
Instance details

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.

Constructors

CustomSpecPreprocessor (SpecMetaArgs -> SpecRuntime bk -> Specs bk -> Specs bk) 

Instances

Instances details
Default (CustomSpecPreprocessor bk) # 
Instance details

Defined in Napkin.Spec.Cli

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

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 ()

specMainWith #

Arguments

:: 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

specMainWithInterpreter #

Arguments

:: 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 TableSpecTags 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.