Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
A module to adapt our effect stack for use in Spec pipelines. Ideally, the Spec machinery would only use this module to access Effects related concerns.
Synopsis
- data ProgramDependenciesAndQueries b
- = SinglePath (DryRunResult b)
- | MultiplePaths {
- createPath :: DryRunResult b
- updatePath :: DryRunResult b
- summarize :: ProgramDependenciesAndQueries b -> DryRunResult b
- data DryRunResult b = DryRunResult {
- dependencies :: Dependencies
- artifacts :: Artifacts
- queries :: [DumpItem b]
- loadedSqlQueries :: [(FilePath, Query)]
- assertions :: AssertionLog
- programDependenciesAndQueries :: forall b m. (MonadIO m, MustacheBackend b, RunBackendEffect b, DumpBackendRequirements b) => RuntimeEnv -> InterpretedSpecEnvironment -> SpecTableName -> SpecProgram b -> m (Either NapkinEffectError (ProgramDependenciesAndQueries b))
- runProgramReal :: forall m b a. (AnnotateWriteIO m b, AnnotateReadIO m b, SqlWriteIO m b, SqlReadIO m b, TemplateIO m b, RunBackendEffect b) => RuntimeEnv -> InterpretedSpecEnvironment -> BackendConn b -> Ref Table -> SpecProgram' b a -> m (Either NapkinEffectError a)
- runGlobalHookProgramReal :: forall b m a. (AnnotateWriteIO m b, AnnotateReadIO m b, SqlWriteIO m b, SqlReadIO m b, TemplateIO m b, RunBackendEffect b) => RuntimeEnv -> InterpretedSpecEnvironment -> BackendConn b -> LogItem -> GlobalHookProgram' b a -> m (Either NapkinEffectError (Either (NonEmpty AssertionEntry) ([AssertionEntry], a)))
- runHookProgramReal :: forall b m a. (AnnotateWriteIO m b, AnnotateReadIO m b, SqlWriteIO m b, SqlReadIO m b, TemplateIO m b, RunBackendEffect b) => Ref Table -> RuntimeEnv -> InterpretedSpecEnvironment -> BackendConn b -> LogItem -> HookProgram' b a -> m (Either NapkinEffectError (Either (NonEmpty AssertionEntry) ([AssertionEntry], a)))
- interceptDiscoverDependencies :: forall b r rs a. (Members [Assertion, AnnotateWrite b, AnnotateRead b, SqlRead b, SqlWrite b, External, Input (Transformed HiddenDependencies), Input (Transformed HiddenArtifacts), Input (Transformed TargetName), Log] r, r ~ (External : (SqlWrite b : (SqlRead b : (AnnotateRead b : (AnnotateWrite b : rs))))), DumpBackendRequirements b) => Sem (Output ExtraDependencies : r) a -> Sem r ((Dependencies, Artifacts, [DumpItem b]), a)
- runTableEnv :: Members [Input UTCTime, Input RandomToken] r => QueryTransformer -> TargetName -> Sem ([Input (Transformed TargetName), Input (Transformed HiddenArtifacts), Input (Transformed HiddenDependencies), Reader QueryTransformer, Input TemporaryTableName, Reader TargetName, Reader HiddenArtifacts, Reader HiddenDependencies] ++ r) a -> Sem r a
- runSqlFake :: forall bk r a. Members [Input (Transformed TargetName), Reader HiddenDependencies, Input RandomToken] r => TargetExists -> Sem (External : (SqlWrite bk : (SqlRead bk : (AnnotateRead bk : (AnnotateWrite bk : r))))) a -> Sem r (IState, a)
- runSqlReal :: forall b r a m. (Members [Embed m, FatalError, Log, Reader QueryTransformer, Output ExtraDependencies] r, SqlReadIO m b, SqlWriteIO m b, AnnotateWriteIO m b, AnnotateReadIO m b, TemplateIO m b) => BackendConn b -> RuntimeEnv -> Sem (External : (Template : (SqlWrite b : (SqlRead b : (AnnotateRead b : (AnnotateWrite b : r)))))) a -> Sem r a
- runSqlParsing :: forall b r m a. (TemplateIO m b, Members [Embed m, SqlWrite b, Output ExtraDependencies, SqlRead b, Log] r) => RuntimeEnv -> ExternMacros -> SQLDialect -> Maybe (Sem (SqlParse : (SqlRender : (Reader SQLDialect : r))) a -> Sem (SqlParse : (SqlRender : (Reader SQLDialect : r))) a) -> Sem (Reader ConnectionString : (LoadQuery : (LocalFile : (Template : (SqlParse : (SqlRender : (Reader SQLDialect : r))))))) a -> Sem r a
- runCoreFake :: (Member (Embed m) r, MonadIO m) => Sem (Input RandomToken : (Time : (Log : r))) a -> Sem r a
- runCoreReal :: (Member (Embed m) r, Katip m) => LogItem -> Sem (Input RandomToken : (Time : (Log : r))) a -> Sem r a
- runTransformedTargetName :: Members [Reader TargetName, Reader QueryTransformer] r => Sem (Input (Transformed TargetName) ': r) a -> Sem r a
- runTransformedHiddenDependencies :: Members [Reader HiddenDependencies, Reader QueryTransformer] r => Sem (Input (Transformed HiddenDependencies) ': r) a -> Sem r a
- runTransformedHiddenArtifacts :: Members [Reader HiddenArtifacts, Reader QueryTransformer] r => Sem (Input (Transformed HiddenArtifacts) ': r) a -> Sem r a
Documentation
data ProgramDependenciesAndQueries b #
SinglePath (DryRunResult b) | |
MultiplePaths | |
|
summarize :: ProgramDependenciesAndQueries b -> DryRunResult b #
data DryRunResult b #
DryRunResult | |
|
Instances
programDependenciesAndQueries :: forall b m. (MonadIO m, MustacheBackend b, RunBackendEffect b, DumpBackendRequirements b) => RuntimeEnv -> InterpretedSpecEnvironment -> SpecTableName -> SpecProgram b -> m (Either NapkinEffectError (ProgramDependenciesAndQueries b)) #
Merely extracts all detectable dependencies out of the program.
runProgramReal :: forall m b a. (AnnotateWriteIO m b, AnnotateReadIO m b, SqlWriteIO m b, SqlReadIO m b, TemplateIO m b, RunBackendEffect b) => RuntimeEnv -> InterpretedSpecEnvironment -> BackendConn b -> Ref Table -> SpecProgram' b a -> m (Either NapkinEffectError a) #
Actually executes the given program
runGlobalHookProgramReal :: forall b m a. (AnnotateWriteIO m b, AnnotateReadIO m b, SqlWriteIO m b, SqlReadIO m b, TemplateIO m b, RunBackendEffect b) => RuntimeEnv -> InterpretedSpecEnvironment -> BackendConn b -> LogItem -> GlobalHookProgram' b a -> m (Either NapkinEffectError (Either (NonEmpty AssertionEntry) ([AssertionEntry], a))) #
runHookProgramReal :: forall b m a. (AnnotateWriteIO m b, AnnotateReadIO m b, SqlWriteIO m b, SqlReadIO m b, TemplateIO m b, RunBackendEffect b) => Ref Table -> RuntimeEnv -> InterpretedSpecEnvironment -> BackendConn b -> LogItem -> HookProgram' b a -> m (Either NapkinEffectError (Either (NonEmpty AssertionEntry) ([AssertionEntry], a))) #
interceptDiscoverDependencies :: forall b r rs a. (Members [Assertion, AnnotateWrite b, AnnotateRead b, SqlRead b, SqlWrite b, External, Input (Transformed HiddenDependencies), Input (Transformed HiddenArtifacts), Input (Transformed TargetName), Log] r, r ~ (External : (SqlWrite b : (SqlRead b : (AnnotateRead b : (AnnotateWrite b : rs))))), DumpBackendRequirements b) => Sem (Output ExtraDependencies : r) a -> Sem r ((Dependencies, Artifacts, [DumpItem b]), a) #
runTableEnv :: Members [Input UTCTime, Input RandomToken] r => QueryTransformer -> TargetName -> Sem ([Input (Transformed TargetName), Input (Transformed HiddenArtifacts), Input (Transformed HiddenDependencies), Reader QueryTransformer, Input TemporaryTableName, Reader TargetName, Reader HiddenArtifacts, Reader HiddenDependencies] ++ r) a -> Sem r a #
runSqlFake :: forall bk r a. Members [Input (Transformed TargetName), Reader HiddenDependencies, Input RandomToken] r => TargetExists -> Sem (External : (SqlWrite bk : (SqlRead bk : (AnnotateRead bk : (AnnotateWrite bk : r))))) a -> Sem r (IState, a) #
runSqlReal :: forall b r a m. (Members [Embed m, FatalError, Log, Reader QueryTransformer, Output ExtraDependencies] r, SqlReadIO m b, SqlWriteIO m b, AnnotateWriteIO m b, AnnotateReadIO m b, TemplateIO m b) => BackendConn b -> RuntimeEnv -> Sem (External : (Template : (SqlWrite b : (SqlRead b : (AnnotateRead b : (AnnotateWrite b : r)))))) a -> Sem r a #
runSqlParsing :: forall b r m a. (TemplateIO m b, Members [Embed m, SqlWrite b, Output ExtraDependencies, SqlRead b, Log] r) => RuntimeEnv -> ExternMacros -> SQLDialect -> Maybe (Sem (SqlParse : (SqlRender : (Reader SQLDialect : r))) a -> Sem (SqlParse : (SqlRender : (Reader SQLDialect : r))) a) -> Sem (Reader ConnectionString : (LoadQuery : (LocalFile : (Template : (SqlParse : (SqlRender : (Reader SQLDialect : r))))))) a -> Sem r a #
runCoreFake :: (Member (Embed m) r, MonadIO m) => Sem (Input RandomToken : (Time : (Log : r))) a -> Sem r a #
runCoreReal :: (Member (Embed m) r, Katip m) => LogItem -> Sem (Input RandomToken : (Time : (Log : r))) a -> Sem r a #
runTransformedTargetName :: Members [Reader TargetName, Reader QueryTransformer] r => Sem (Input (Transformed TargetName) ': r) a -> Sem r a #
runTransformedHiddenDependencies :: Members [Reader HiddenDependencies, Reader QueryTransformer] r => Sem (Input (Transformed HiddenDependencies) ': r) a -> Sem r a #
runTransformedHiddenArtifacts :: Members [Reader HiddenArtifacts, Reader QueryTransformer] r => Sem (Input (Transformed HiddenArtifacts) ': r) a -> Sem r a #