napkin-0.5.8
Copyright(c) Soostone Inc 2020
LicenseAllRightsReserved
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Napkin.Run.Execute

Description

 
Synopsis

Documentation

type Success = Bool #

checkUpdateStrategy :: MonadIO m => UTCTime -> Maybe SpecRun -> m Bool -> DepChain -> UpdateStrategy -> m Bool #

Should I be running the update?

newtype SpecOpts #

Constructors

SpecOpts 

Fields

Instances

Instances details
Default SpecOpts # 
Instance details

Defined in Napkin.Run.Execute

Methods

def :: SpecOpts #

type SpecBackend bk drop t1 t2 t3 t4 t5 t6 t7 t8 t9 = (Command CreateViewAs t3 bk, Command CheckTableExists Bool bk, Command Grant t1 bk, Command (CreateTableAs (BackendTableMeta bk)) t4 bk, Command InsertIntoQuery t6 bk, Command drop t5 bk, Command DropView t2 bk, Command DropTable t5 bk, Command CopyTable t9 bk, Command DeleteFrom t8 bk, Command RenameTable t7 bk, Command GetRelationSchema (Fields Field) bk, Drop (CreateTableAs (BackendTableMeta bk)) drop, RenderSql (CreateTableAs (BackendTableMeta bk)) bk, RenderSql CreateViewAs bk, RenderSql (Ref Table) bk, RenderSql Query bk, RenderSql SExp bk, ReplaceReference bk, ParseSQL bk, Backend bk, MustacheBackend bk, Typeable bk, IsBackendTableMeta bk, RunBackendEffect bk) #

What we seem to need to be able to call executeSpec; it's basically all about choosing a backend that satisfies the needed operations.

executeSpec :: forall m bk drop t1 t2 t3 t4 t5 t6 t7 t8 t9. (MonadFix m, MonadBaseControl IO m, MonadMask m, Katip m, MonadReader ComboEnv m, SpecBackend bk drop t1 t2 t3 t4 t5 t6 t7 t8 t9, MonadQueryStats m, RunBackendEffect bk) => RuntimeEnv -> bk -> MetadataBeamConnection -> SpecRuntime bk -> SpecOpts -> InterpretedSpec bk -> m Success #

dryRun :: (MonadIO m, Katip m) => AppName -> Pipeline -> Ref Table -> DepChain -> b -> t -> m (Either a b, SpecRun) #

A run that succeeds immediately without ever actually running anything.

reportProgress :: Show a => Maybe RuntimeEventQueue -> Ref Table -> ComboT IO (Either a b, SpecRun) -> ComboT IO (Either a b, SpecRun) #

Report runtime updates as the Spec execution progresses.

class Exception a => ShowExceptionWithPrefix a where #

Methods

showParts :: a -> (Text, Text) #

Instances

Instances details
ShowExceptionWithPrefix ValidationError # 
Instance details

Defined in Napkin.Run.Execute

validateAndPreprocessSpecs :: forall m bk. (MonadIO m, ValidateAndPreprocess bk) => RuntimeEnv -> InterpretedSpec bk -> m (Either [ValidationError] (Specs bk)) #

Run basic checks against all Specs and convert every raw query to normal Query.

runHook :: forall backend t1 tr t8 t7 t4 t3 t5 t6. (Backend backend, Command (CreateTableAs (BackendTableMeta backend)) t1 backend, Command InsertIntoQuery tr backend, Command DeleteFrom t8 backend, Command DropView t7 backend, Command DropTable t6 backend, Command CopyTable t5 backend, Command RenameTable t4 backend, Command CreateViewAs t3 backend, Command CheckTableExists Bool backend, Command GetRelationSchema (Fields Field) backend, ParseSQL backend, MustacheBackend backend, IsBackendTableMeta backend, RunBackendEffect backend, RenderSql (Alias Relation) backend, RenderSql (Alias SExp) backend) => RuntimeEnv -> ExternMacros -> BackendConn backend -> SpecMetaArgs -> [Text] -> HookProgram backend -> ComboT IO (Either (NonEmpty AssertionEntry) [AssertionEntry]) #