napkin-0.5.10
Safe HaskellNone
LanguageHaskell2010

Napkin.Run.Effects.Runtime

Description

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

Documentation

validateSpecProgram :: forall b m. (MonadIO m, ParseSQL b, ReifiesBackend b, MustacheBackend b, IsBackendTableMeta b, RunBackendEffect b) => RuntimeEnv -> ExternMacros -> Ref Table -> CustomValidator -> SpecProgram b -> SpecMetaArgs -> m (Either NapkinEffectError AssertionLog) #

Do a dry run of the program to exercise any validations that may be present.

to follow. Perhaps we can have this step cache loaded SQL files, SQL parsing, resolutions, etc and that cache can be fed to the real run to avoid re-doing expensive operations in the effect stack.

runProgramReal :: forall m b a t1 t2 t3 t4 t5 t6 t7 t8 tr. (SqlWriteIO m b a t1 t2 t3 t4 t5 t6 t7 t8, SqlReadIO m b a tr, ExternalCreateIO m, SqlParseIO b, LocalFileIO b m, m ~ ComboT IO, RunBackendEffect b) => RuntimeEnv -> ExternMacros -> BackendConn b -> SpecMetaArgs -> Ref Table -> SpecProgram b -> m (Either NapkinEffectError ()) #

Actually executes the given program

runHookProgramReal :: forall b m a t1 t2 t3 t4 t5 t6 t7 t8 tr. (SqlWriteIO m b a t1 t2 t3 t4 t5 t6 t7 t8, SqlReadIO m b a tr, ExternalCreateIO m, SqlParseIO b, LocalFileIO b m, m ~ ComboT IO, RunBackendEffect b) => RuntimeEnv -> ExternMacros -> BackendConn b -> SpecMetaArgs -> HookProgram b -> m (Either NapkinEffectError (Either (NonEmpty AssertionEntry) [AssertionEntry])) #

runSqlReal :: forall bk r a. _ => BackendConn bk -> RuntimeEnv -> Sem (Reader DynamicMeta ': (ExternalCreate ': (SqlWrite ': (SqlRead ': r)))) a -> Sem r a #

runSqlParsing :: forall b r m a. (SqlParseIO b, LocalFileIO b m, Members [Embed m, SqlWrite, SqlRead, Log, Reader ExtraDependencies] r) => RuntimeEnv -> ExternMacros -> Maybe (Sem (SqlParse ': (SqlRender ': r)) a -> Sem (SqlParse ': (SqlRender ': r)) a) -> Sem (LocalFile ': (SqlParse ': (SqlRender ': 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 #