Copyright | (c) Soostone Inc 2020 |
---|---|
License | AllRightsReserved |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- type ValidateAndPreprocess bk = (ParseSQL bk, ReifiesBackend bk, MustacheBackend bk, IsBackendTableMeta bk, RunBackendEffect bk)
- type TableAsync = Async TableAsyncResult
- type TableAsyncResult = (Either () ([AssertionEntry], SpecRun), TrackingQueryStats)
- newtype HookAssertionError = HookAssertionError (NonEmpty AssertionEntry)
- 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)
- type Success = Bool
- 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 -> ValidatedInterpretedSpec bk -> Set (Ref Table) -> m Success
- reportFatalError :: Maybe RuntimeEventQueue -> IO ()
- reportTableFailed :: Maybe RuntimeEventQueue -> Ref Table -> String -> IO ()
- reportProgress :: (Show a, Exception a) => Maybe RuntimeEventQueue -> Ref Table -> ComboT IO (Either a b, SpecRun) -> ComboT IO (Either a b, SpecRun)
- reportCompletion :: MonadIO m => Maybe RuntimeEventQueue -> TrackingQueryStats -> m ()
- reportSkipUpdate :: MonadIO m => Maybe RuntimeEventQueue -> Ref Table -> m ()
- validateSpecs :: forall m bk. (MonadIO m, ValidateAndPreprocess bk) => RuntimeEnv -> RawInterpretedSpec bk -> m (Either (NonEmpty ValidationError) (ValidatedInterpretedSpec bk))
- prettyQueryStatsForTable :: Ref Table -> TrackingQueryStats -> String
- logAssertions :: (Katip m, Traversable l) => l AssertionEntry -> m ()
- logFinalReport :: (Katip m, RenderSql (Ref Table) bk, MonadQueryStats m) => bk -> [(Ref Table, Either SomeException (Either b ([AssertionEntry], SpecRun), TrackingQueryStats))] -> [Either SomeException (Maybe (Either (NonEmpty AssertionEntry) [AssertionEntry]), TrackingQueryStats)] -> m ()
- srDuration :: SpecRun -> NominalDiffTime
Documentation
type ValidateAndPreprocess bk = (ParseSQL bk, ReifiesBackend bk, MustacheBackend bk, IsBackendTableMeta bk, RunBackendEffect bk) #
type TableAsync = Async TableAsyncResult #
type TableAsyncResult = (Either () ([AssertionEntry], SpecRun), TrackingQueryStats) #
newtype HookAssertionError #
Instances
Show HookAssertionError # | |
Defined in Napkin.Run.Execute showsPrec :: Int -> HookAssertionError -> ShowS # show :: HookAssertionError -> String # showList :: [HookAssertionError] -> ShowS # | |
Exception HookAssertionError # | |
Defined in Napkin.Run.Execute |
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 -> ValidatedInterpretedSpec bk -> Set (Ref Table) -> m Success #
reportFatalError :: Maybe RuntimeEventQueue -> IO () #
reportTableFailed :: Maybe RuntimeEventQueue -> Ref Table -> String -> IO () #
reportProgress :: (Show a, Exception 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.
reportCompletion :: MonadIO m => Maybe RuntimeEventQueue -> TrackingQueryStats -> m () #
reportSkipUpdate :: MonadIO m => Maybe RuntimeEventQueue -> Ref Table -> m () #
validateSpecs :: forall m bk. (MonadIO m, ValidateAndPreprocess bk) => RuntimeEnv -> RawInterpretedSpec bk -> m (Either (NonEmpty ValidationError) (ValidatedInterpretedSpec bk)) #
Run basic checks against all Specs and convert every raw query to normal Query.
logAssertions :: (Katip m, Traversable l) => l AssertionEntry -> m () #
logFinalReport :: (Katip m, RenderSql (Ref Table) bk, MonadQueryStats m) => bk -> [(Ref Table, Either SomeException (Either b ([AssertionEntry], SpecRun), TrackingQueryStats))] -> [Either SomeException (Maybe (Either (NonEmpty AssertionEntry) [AssertionEntry]), TrackingQueryStats)] -> m () #
srDuration :: SpecRun -> NominalDiffTime #