Safe Haskell | None |
---|---|
Language | Haskell2010 |
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, ReifiesBackend b, MustacheBackend b, RunBackendEffect b, DumpBackendRequirements b) => RuntimeEnv -> InterpretedSpecEnvironment -> Ref Table -> SpecProgram b -> m (Either NapkinEffectError (ProgramDependenciesAndQueries b))
- runProgramReal :: forall m b a ret. (SqlWriteIO m b a, SqlReadIO m b a, ExternalCreateIO m, TemplateIO m b, m ~ ComboT IO, RunBackendEffect b) => RuntimeEnv -> InterpretedSpecEnvironment -> BackendConn b -> Ref Table -> SpecProgram' b ret -> m (Either NapkinEffectError ret)
- runHookProgramReal :: forall b m a ret. (SqlWriteIO m b a, SqlReadIO m b a, ExternalCreateIO m, TemplateIO m b, m ~ ComboT IO, RunBackendEffect b) => RuntimeEnv -> InterpretedSpecEnvironment -> BackendConn b -> LogItem -> HookProgram' b ret -> m (Either NapkinEffectError (Either (NonEmpty AssertionEntry) ([AssertionEntry], ret)))
- interceptDiscoverDependencies :: forall b r rs a. (Members [Assertion, SqlRead b, SqlWrite b, ExternalCreate, Input (Transformed HiddenDependencies), Input (Transformed HiddenArtifacts), Input (Transformed TargetName), Log] r, r ~ (ExternalCreate ': (SqlWrite b ': (SqlRead b ': rs))), DumpBackendRequirements b) => Sem (Output ExtraDependencies ': r) a -> Sem r ((Dependencies, Artifacts, [DumpItem b]), a)
- runTableEnv :: QueryTransformer -> TargetName -> Sem ([Input (Transformed TargetName), Input (Transformed HiddenArtifacts), Input (Transformed HiddenDependencies), Reader QueryTransformer, 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 (ExternalCreate ': (SqlWrite bk ': (SqlRead 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 a, SqlWriteIO m b a, TemplateIO m b) => BackendConn b -> RuntimeEnv -> Sem (ExternalCreate ': (Template ': (SqlWrite b ': (SqlRead b ': r)))) a -> Sem r a
- runSqlParsing :: forall b r m a. (ToDbBackend b, 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 (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, MonadIO m, 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, ReifiesBackend b, MustacheBackend b, RunBackendEffect b, DumpBackendRequirements b) => RuntimeEnv -> InterpretedSpecEnvironment -> Ref Table -> SpecProgram b -> m (Either NapkinEffectError (ProgramDependenciesAndQueries b)) #
Merely extracts all detectable dependencies out of the program.
runProgramReal :: forall m b a ret. (SqlWriteIO m b a, SqlReadIO m b a, ExternalCreateIO m, TemplateIO m b, m ~ ComboT IO, RunBackendEffect b) => RuntimeEnv -> InterpretedSpecEnvironment -> BackendConn b -> Ref Table -> SpecProgram' b ret -> m (Either NapkinEffectError ret) #
Actually executes the given program
runHookProgramReal :: forall b m a ret. (SqlWriteIO m b a, SqlReadIO m b a, ExternalCreateIO m, TemplateIO m b, m ~ ComboT IO, RunBackendEffect b) => RuntimeEnv -> InterpretedSpecEnvironment -> BackendConn b -> LogItem -> HookProgram' b ret -> m (Either NapkinEffectError (Either (NonEmpty AssertionEntry) ([AssertionEntry], ret))) #
interceptDiscoverDependencies :: forall b r rs a. (Members [Assertion, SqlRead b, SqlWrite b, ExternalCreate, Input (Transformed HiddenDependencies), Input (Transformed HiddenArtifacts), Input (Transformed TargetName), Log] r, r ~ (ExternalCreate ': (SqlWrite b ': (SqlRead b ': rs))), DumpBackendRequirements b) => Sem (Output ExtraDependencies ': r) a -> Sem r ((Dependencies, Artifacts, [DumpItem b]), a) #
runTableEnv :: QueryTransformer -> TargetName -> Sem ([Input (Transformed TargetName), Input (Transformed HiddenArtifacts), Input (Transformed HiddenDependencies), Reader QueryTransformer, 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 (ExternalCreate ': (SqlWrite bk ': (SqlRead 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 a, SqlWriteIO m b a, TemplateIO m b) => BackendConn b -> RuntimeEnv -> Sem (ExternalCreate ': (Template ': (SqlWrite b ': (SqlRead b ': r)))) a -> Sem r a #
runSqlParsing :: forall b r m a. (ToDbBackend b, 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 (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, MonadIO m, 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 #