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
- = SinglePath DryRunResult
- | MultiplePaths { }
- summarize :: ProgramDependenciesAndQueries -> DryRunResult
- data DryRunResult = DryRunResult {
- dependencies :: Dependencies
- artifacts :: Artifacts
- queries :: [DumpItem]
- loadedSqlQueries :: [(FilePath, Query)]
- assertions :: AssertionLog
- programDependenciesAndQueries :: forall b m. (MonadIO m, ReifiesBackend b, MustacheBackend b, RunBackendEffect b, Show (BackendTableMeta b), Show (BackendViewMeta b), Show (BackendMaterializedViewMeta b)) => RuntimeEnv -> InterpretedSpecEnvironment -> Ref Table -> SpecProgram b -> m (Either NapkinEffectError ProgramDependenciesAndQueries)
- runProgramReal :: forall m b a t1 t2 t3 t4 t5 t6 t7 t8 tr ret. (SqlWriteIO m b a t1 t2 t3 t4 t5 t6 t7 t8, SqlReadIO m b a tr, 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 t1 t2 t3 t4 t5 t6 t7 t8 tr ret. (SqlWriteIO m b a t1 t2 t3 t4 t5 t6 t7 t8, SqlReadIO m b a tr, ExternalCreateIO m, TemplateIO m b, m ~ ComboT IO, RunBackendEffect b) => RuntimeEnv -> InterpretedSpecEnvironment -> BackendConn b -> HookProgram' b ret -> m (Either NapkinEffectError (Either (NonEmpty AssertionEntry) ([AssertionEntry], ret)))
- interceptDiscoverDependencies :: forall b r rs a. (Members [SqlRead, SqlWrite b, ExternalCreate, Input (Transformed HiddenDependencies), Input (Transformed HiddenArtifacts), Input (Transformed TargetName), Log] r, r ~ (ExternalCreate ': (SqlWrite b ': (SqlRead ': rs))), Show (BackendTableMeta b), Show (BackendViewMeta b), Show (BackendMaterializedViewMeta b), RenderSql Query b, RenderSql SExp b) => Sem (Output ExtraDependencies ': r) a -> Sem r ((Dependencies, Artifacts, [DumpItem]), 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 ': r))) a -> Sem r (IState, a)
- runSqlReal :: forall b r a m tr t1 t2 t3 t4 t5 t6 t7 t8. (Members [Embed m, FatalError, Log, Reader QueryTransformer, Output ExtraDependencies] r, SqlReadIO m b a tr, SqlWriteIO m b a t1 t2 t3 t4 t5 t6 t7 t8, TemplateIO m b) => BackendConn b -> RuntimeEnv -> Sem (ExternalCreate ': (Template ': (SqlWrite b ': (SqlRead ': r)))) a -> Sem r a
- runSqlParsing :: forall b r m a. (ToDbBackend b, TemplateIO m b, Members [Embed m, SqlWrite b, Output ExtraDependencies, SqlRead, 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) => 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 DryRunResult #
DryRunResult | |
|
Instances
programDependenciesAndQueries :: forall b m. (MonadIO m, ReifiesBackend b, MustacheBackend b, RunBackendEffect b, Show (BackendTableMeta b), Show (BackendViewMeta b), Show (BackendMaterializedViewMeta b)) => RuntimeEnv -> InterpretedSpecEnvironment -> Ref Table -> SpecProgram b -> m (Either NapkinEffectError ProgramDependenciesAndQueries) #
Merely extracts all detectable dependencies out of the program.
runProgramReal :: forall m b a t1 t2 t3 t4 t5 t6 t7 t8 tr ret. (SqlWriteIO m b a t1 t2 t3 t4 t5 t6 t7 t8, SqlReadIO m b a tr, 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 t1 t2 t3 t4 t5 t6 t7 t8 tr ret. (SqlWriteIO m b a t1 t2 t3 t4 t5 t6 t7 t8, SqlReadIO m b a tr, ExternalCreateIO m, TemplateIO m b, m ~ ComboT IO, RunBackendEffect b) => RuntimeEnv -> InterpretedSpecEnvironment -> BackendConn b -> HookProgram' b ret -> m (Either NapkinEffectError (Either (NonEmpty AssertionEntry) ([AssertionEntry], ret))) #
interceptDiscoverDependencies :: forall b r rs a. (Members [SqlRead, SqlWrite b, ExternalCreate, Input (Transformed HiddenDependencies), Input (Transformed HiddenArtifacts), Input (Transformed TargetName), Log] r, r ~ (ExternalCreate ': (SqlWrite b ': (SqlRead ': rs))), Show (BackendTableMeta b), Show (BackendViewMeta b), Show (BackendMaterializedViewMeta b), RenderSql Query b, RenderSql SExp b) => Sem (Output ExtraDependencies ': r) a -> Sem r ((Dependencies, Artifacts, [DumpItem]), 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 ': r))) a -> Sem r (IState, a) #
runSqlReal :: forall b r a m tr t1 t2 t3 t4 t5 t6 t7 t8. (Members [Embed m, FatalError, Log, Reader QueryTransformer, Output ExtraDependencies] r, SqlReadIO m b a tr, SqlWriteIO m b a t1 t2 t3 t4 t5 t6 t7 t8, TemplateIO m b) => BackendConn b -> RuntimeEnv -> Sem (ExternalCreate ': (Template ': (SqlWrite b ': (SqlRead ': r)))) a -> Sem r a #
runSqlParsing :: forall b r m a. (ToDbBackend b, TemplateIO m b, Members [Embed m, SqlWrite b, Output ExtraDependencies, SqlRead, 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) => 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 #