Safe Haskell | None |
---|---|
Language | GHC2024 |
Synopsis
- module Napkin.Run.Effects.Languages.FatalError
- describe :: forall (r :: EffectRow) a. Members '[Assertion :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => Text -> Sem r a -> Sem r a
- assert :: forall (r :: EffectRow). Member (Assertion :: (Type -> Type) -> Type -> Type) r => Text -> AssertionStatus -> Sem r ()
- assertError :: forall (r :: EffectRow). Member (Assertion :: (Type -> Type) -> Type -> Type) r => Text -> Sem ((Error Text :: (Type -> Type) -> Type -> Type) ': r) () -> Sem r ()
- data SQLDialect
- data AssertionStatus
- data Assertion (m :: k) a
- getCurrentTime :: forall (effs :: EffectRow). Member (Time :: (Type -> Type) -> Type -> Type) effs => Sem effs UTCTime
- data External (m :: k) a
- dropView :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => Ref Table -> MissingBehavior -> Cascade -> Sem r ()
- assertM :: forall (r :: EffectRow). Member (Assertion :: (Type -> Type) -> Type -> Type) r => Text -> Sem r AssertionStatus -> Sem r ()
- logInfo :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LText -> Sem effs ()
- addDependency :: forall (r :: EffectRow). Member (Output ExtraDependencies :: (Type -> Type) -> Type -> Type) r => Ref Table -> Sem r ()
- getAnnotations :: forall {k} (b :: k) (r :: EffectRow). Member (AnnotateRead b :: (Type -> Type) -> Type -> Type) r => Ref Table -> Sem r TableAnnotations
- type Time = Input UTCTime :: k1 -> Type -> Type
- logError :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LText -> Sem effs ()
- logDebug :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LText -> Sem effs ()
- renderQuery :: forall (r :: EffectRow). Member (SqlRender :: (Type -> Type) -> Type -> Type) r => Query -> Sem r SqlText
- checkTableExists :: forall {k} (b :: k) (r :: EffectRow). Member (SqlRead b :: (Type -> Type) -> Type -> Type) r => Ref Table -> Sem r Bool
- renameTable :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => Ref Table -> Ref Table -> Sem r ()
- newtype RandomToken = RandomToken {}
- type family Members (es :: [Effect]) (r :: EffectRow) where ...
- data Sem (r :: EffectRow) a
- class Member (t :: Effect) (r :: EffectRow)
- executeExternalCommand :: forall (effs :: EffectRow). Members '[FatalError :: (Type -> Type) -> Type -> Type, External :: (Type -> Type) -> Type -> Type] effs => ExternalCommand -> Sem effs ()
- type Log = Output LogLine :: k -> Type -> Type
- logNotice :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LText -> Sem effs ()
- logWarning :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LText -> Sem effs ()
- logCritical :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LText -> Sem effs ()
- logAlert :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LText -> Sem effs ()
- logEmergency :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LText -> Sem effs ()
- logDebug' :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LogItem -> LText -> Sem effs ()
- logInfo' :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LogItem -> LText -> Sem effs ()
- logNotice' :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LogItem -> LText -> Sem effs ()
- logWarning' :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LogItem -> LText -> Sem effs ()
- logError' :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LogItem -> LText -> Sem effs ()
- logCritical' :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LogItem -> LText -> Sem effs ()
- logAlert' :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LogItem -> LText -> Sem effs ()
- logEmergency' :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LogItem -> LText -> Sem effs ()
- pattern FailureWithMessage :: Text -> AssertionStatus
- assert' :: forall (r :: EffectRow). Member (Assertion :: (Type -> Type) -> Type -> Type) r => AssertionGroup -> AssertionSeverity -> Text -> AssertionStatus -> Sem r ()
- assertTrue :: forall (r :: EffectRow). Member (Assertion :: (Type -> Type) -> Type -> Type) r => Text -> Bool -> Sem r ()
- assertEquals :: forall a (r :: EffectRow). (Eq a, Member (Assertion :: (Type -> Type) -> Type -> Type) r) => Text -> a -> a -> Sem r ()
- assertTrueWith :: forall (r :: EffectRow). Member (Assertion :: (Type -> Type) -> Type -> Type) r => Text -> Bool -> Text -> Sem r ()
- assertTrueWithM :: forall (r :: EffectRow). Member (Assertion :: (Type -> Type) -> Type -> Type) r => Text -> Bool -> Sem r Text -> Sem r ()
- failedAssertion :: forall (r :: EffectRow). Member (Assertion :: (Type -> Type) -> Type -> Type) r => Text -> Sem r ()
- warnOnly :: forall (r :: EffectRow) a. Member (Assertion :: (Type -> Type) -> Type -> Type) r => Sem r a -> Sem r a
- describe' :: forall (r :: EffectRow) a. Members '[Assertion :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => [Text] -> Sem r a -> Sem r a
- data SqlRead (b :: k) (m :: k1) a
- runQuery :: forall {k} (b :: k) (r :: EffectRow). Member (SqlRead b :: (Type -> Type) -> Type -> Type) r => Query -> Sem r [Map Text Value]
- getTableKind :: forall {k} (b :: k) (r :: EffectRow). Member (SqlRead b :: (Type -> Type) -> Type -> Type) r => Ref Table -> Sem r TableKind
- runQuerySingleAnswer :: forall {k} (b :: k) a (r :: EffectRow). (Val a, Member (SqlRead b :: (Type -> Type) -> Type -> Type) r) => Query -> Sem r (Maybe a)
- getRelationSchema :: forall {k} (b :: k) (r :: EffectRow). Members '[SqlRead b :: (Type -> Type) -> Type -> Type, Input TemporaryTableName :: (Type -> Type) -> Type -> Type] r => Relation -> Sem r [BackendSchemaField b]
- data SqlRender (m :: k) a
- renderSExp :: forall (r :: EffectRow). Member (SqlRender :: (Type -> Type) -> Type -> Type) r => SExp -> Sem r SqlText
- data SqlParse (m :: k) a
- parseSqlQuery :: forall (r :: EffectRow). Members '[SqlParse :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type] r => SourceLocation -> Text -> Sem r Query
- parseSqlExp :: forall (r :: EffectRow). Members '[SqlParse :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type] r => SourceLocation -> Text -> Sem r SExp
- parseStatements :: forall (r :: EffectRow) a. (Members '[SqlParse :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type] r, Stateable a) => SourceLocation -> Text -> Sem r [a]
- overrideDialect :: forall (r :: EffectRow) a. Member (Reader SQLDialect) r => SQLDialect -> Sem r a -> Sem r a
- data LoadQuery (m :: k) a
- newtype LoadQueryError = LoadQueryError Text
- loadQueryFromFile :: forall (r :: EffectRow). Member (LoadQuery :: (Type -> Type) -> Type -> Type) r => FilePath -> SqlTemplateVariables -> Sem r (Either LoadQueryError Text)
- loadSqlFile :: forall (r :: EffectRow). Members '[SqlParse :: (Type -> Type) -> Type -> Type, LoadQuery :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type] r => FilePath -> SqlTemplateVariables -> Sem r Query
- optionalArg :: SpecProgramArgumentDescription -> SpecProgramArgumentDefinition
- requiredArg :: SpecProgramArgumentDescription -> SpecProgramArgumentDefinition
- requiredArgDef :: ToJSON a => a -> SpecProgramArgumentDescription -> SpecProgramArgumentDefinition
- announceMetaArguments :: SpecProgramArguments -> b -> (SpecProgramArguments, b)
- noMetaArguments :: b -> (SpecProgramArguments, b)
- data SqlWrite b (m :: k) a
- data MissingBehavior
- data Cascade
- createTableAsWithMeta :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => BackendTableMeta b -> Ref Table -> Query -> Sem r ()
- createViewAsWithMeta :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => BackendViewMeta b -> Ref Table -> Query -> Sem r ()
- createMaterializedViewAsWithMeta :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => BackendMaterializedViewMeta b -> Ref Table -> Query -> Sem r ()
- insertIntoQuery :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => Ref Table -> Query -> Sem r ()
- updateTable :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => UpdateQuery -> Sem r ()
- copyTable :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => Ref Table -> Ref Table -> TableWriteStrategy -> Sem r ()
- dropTable :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => Ref Table -> MissingBehavior -> Cascade -> Sem r ()
- dropMaterializedView :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => Ref Table -> MissingBehavior -> Cascade -> Sem r ()
- deleteFrom :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => Ref Table -> SExp -> Sem r ()
- createTableAs :: forall b (r :: EffectRow). (Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r, Default (BackendTableMeta b)) => Ref Table -> Query -> Sem r ()
- createViewAs :: forall b (r :: EffectRow). (Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r, Default (BackendViewMeta b)) => Ref Table -> Query -> Sem r ()
- createMaterializedViewAs :: forall b (r :: EffectRow). (Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r, Default (BackendMaterializedViewMeta b)) => Ref Table -> Query -> Sem r ()
- newtype TableMemos = TableMemos (Map SpecTableName TableMemo)
- newtype TableMemo = TableMemo [Value]
- newtype MetaArguments = MetaArguments {}
- newtype TargetName = TargetName (Ref Table)
- newtype HiddenArtifacts = HiddenArtifacts (Set (Ref Table))
- newtype HiddenDependencies = HiddenDependencies (Set (Ref Table))
- newtype ExtraDependencies = ExtraDependencies (Set (Ref Table))
- renameReferences :: forall (r :: EffectRow) a. Member (Reader QueryTransformer) r => (Ref Table -> Ref Table) -> Sem r a -> Sem r a
- applyTransformer :: forall (r :: EffectRow) a. Member (Reader QueryTransformer) r => QueryTransformerUnit -> Sem r a -> Sem r a
- hideDependencies :: forall a (r :: EffectRow). Member (Reader HiddenDependencies) r => Set (Ref Table) -> Sem r a -> Sem r a
- hideDependency :: forall a (r :: EffectRow). Member (Reader HiddenDependencies) r => Ref Table -> Sem r a -> Sem r a
- hideArtifact :: forall a (r :: EffectRow). Member (Reader HiddenArtifacts) r => Ref Table -> Sem r a -> Sem r a
- addDependencies :: forall (r :: EffectRow). Member (Output ExtraDependencies :: (Type -> Type) -> Type -> Type) r => Set (Ref Table) -> Sem r ()
- overrideTarget :: forall a (r :: EffectRow). Member (Reader TargetName) r => Ref Table -> Sem r a -> Sem r a
- insertQueryIntoTarget :: forall b (effs :: EffectRow). Members '[SqlWrite b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => Query -> Sem effs ()
- deleteFromTarget :: forall b (effs :: EffectRow). Members '[SqlWrite b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => SExp -> Sem effs ()
- updateTarget :: forall b (effs :: EffectRow). Members '[SqlWrite b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => (Ref Relation -> U ()) -> Sem effs ()
- data AnnotateRead (b :: k) (m :: k1) a
- data TableAnnotations = TableAnnotations {}
- getTargetAnnotations :: forall {k} (b :: k) (effs :: EffectRow). Members '[AnnotateRead b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => Sem effs TableAnnotations
- data AnnotateWrite (b :: k) (m :: k1) a
- annotateTable :: forall {k} (b :: k) (r :: EffectRow). Member (AnnotateWrite b :: (Type -> Type) -> Type -> Type) r => Ref Table -> Text -> Sem r ()
- annotateColumns :: forall {k} (b :: k) (r :: EffectRow). Member (AnnotateWrite b :: (Type -> Type) -> Type -> Type) r => Ref Table -> ColumnsAnnotations -> Sem r ()
- annotateColumn :: forall {k} (b :: k) (effs :: EffectRow). Member (AnnotateWrite b :: (Type -> Type) -> Type -> Type) effs => Ref Table -> Ref SExp -> Text -> Sem effs ()
- annotateTargetTable :: forall {k} (b :: k) (effs :: EffectRow). Members '[AnnotateWrite b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => Text -> Sem effs ()
- annotateTargetColumns :: forall {k} (b :: k) (effs :: EffectRow). Members '[AnnotateWrite b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => ColumnsAnnotations -> Sem effs ()
- annotateTargetColumn :: forall {k} (b :: k) (effs :: EffectRow). Members '[AnnotateWrite b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => Ref SExp -> Text -> Sem effs ()
- data RecreateTable b (m :: k) a
- recreateTableAs :: forall b (r :: EffectRow). Member (RecreateTable b :: (Type -> Type) -> Type -> Type) r => BackendTableMeta b -> Ref Table -> NonEmpty Query -> Sem r ()
- recreateViewAs :: forall b (r :: EffectRow). Member (RecreateTable b :: (Type -> Type) -> Type -> Type) r => BackendViewMeta b -> Ref Table -> Query -> Sem r ()
- recreateMaterializedViewAs :: forall b (r :: EffectRow). Member (RecreateTable b :: (Type -> Type) -> Type -> Type) r => BackendMaterializedViewMeta b -> Ref Table -> Query -> Sem r ()
- recreateTargetTable :: forall b (effs :: EffectRow). Members '[RecreateTable b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => BackendTableMeta b -> NonEmpty Query -> Sem effs ()
- recreateTableStatement :: forall b (effs :: EffectRow). Members '[RecreateTable b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => BackendTableMeta b -> CreateTableDDL -> [InsertStatement] -> Sem effs ()
- recreateTargetView :: forall b (effs :: EffectRow). Members '[RecreateTable b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => BackendViewMeta b -> Query -> Sem effs ()
- recreateTargetMaterializedView :: forall b (effs :: EffectRow). Members '[RecreateTable b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => BackendMaterializedViewMeta b -> Query -> Sem effs ()
- askTextArgDefault :: forall (r :: EffectRow). Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => Text -> Text -> Sem r Text
- askTextArg :: forall (r :: EffectRow). Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => Text -> Sem r Text
- askTextArgMb :: forall (r :: EffectRow). Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => Text -> Sem r (Maybe Text)
- askBoolArgDefault :: forall (r :: EffectRow). Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => Bool -> Text -> Sem r Bool
- askBoolArg :: forall (r :: EffectRow). Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => Text -> Sem r Bool
- askBoolArgMb :: forall (r :: EffectRow). Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => Text -> Sem r (Maybe Bool)
- askNumArgDefault :: forall (r :: EffectRow). Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => Scientific -> Text -> Sem r Scientific
- askNumArg :: forall (r :: EffectRow). Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => Text -> Sem r Scientific
- askNumArgMb :: forall (r :: EffectRow). Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => Text -> Sem r (Maybe Scientific)
- askArg :: forall a (r :: EffectRow). (FromJSON a, Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r) => Text -> Sem r a
- askArgMb :: forall a (r :: EffectRow). (FromJSON a, Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r) => Text -> Sem r (Maybe a)
- withTypedArg :: forall a b (r :: EffectRow). (Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type] r, FromJSON a, Typeable a) => (a -> Sem r b) -> Sem r b
- class RunBackendEffect b where
- runBackendEffectReal :: forall (m :: Type -> Type) (r :: EffectRow) a. (Members '[FatalError :: (Type -> Type) -> Type -> Type, Embed m] r, MonadNapkin b m, SqlIO m, LocalQueryStats b m) => BackendConn b -> Sem (BackendSpecificEffect b ': r) a -> Sem r a
- runBackendEffectFake :: forall (r :: EffectRow) a. Members '[Reader HiddenDependencies, State IState :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type] r => Sem (BackendSpecificEffect b ': r) a -> Sem r a
- interceptBackendEffectDiscoverDependencies :: forall (r :: EffectRow) a. Members '[Input (Transformed HiddenDependencies) :: (Type -> Type) -> Type -> Type, Output Dependencies :: (Type -> Type) -> Type -> Type, BackendSpecificEffect b] r => Sem r a -> Sem r a
- interceptBackendEffectApplyQueryTransformer :: forall (r :: EffectRow) a. Members '[Output ExtraDependencies :: (Type -> Type) -> Type -> Type, Reader QueryTransformer, BackendSpecificEffect b] r => Sem r a -> Sem r a
- backendDependencyValidator :: Proxy b -> [(SpecDependency -> Ref Table) -> SpecsDepsTables -> [WithSpecTable Text]]
- newtype SpecProgramWithArgParser b = SpecProgramWithArgParser (Object -> Parser (SpecProgramArguments, SpecProgram b))
- newtype HookProgramWithArgParser b = HookProgramWithArgParser (Object -> Parser (SpecProgramArguments, HookProgram b))
- type SpecProgram b = SpecProgram' b ()
- type PureGlobalHookProgram b = PureGlobalHookProgram' b ()
- type PureGlobalHookProgram' b a = Sem (PureGlobalHookProgramEffects b) a
- type IOGlobalHookProgram b = IOGlobalHookProgram' b ()
- type IOGlobalHookProgram' b a = Sem (IOGlobalHookProgramEffects b) a
- type HookProgram b = HookProgram' b ()
- type HookProgram' b a = Sem (TableHookProgramEffects b) a
- type SpecProgram' b a = Sem (SpecProgramEffects b) a
- parserlessHook :: HookProgram b -> HookProgramWithArgParser b
- parserlessSpec :: SpecProgram b -> SpecProgramWithArgParser b
- newtype SpecPreprocessorWithArgParser b = SpecPreprocessorWithArgParser (Object -> Parser (SpecProgramArguments, SpecPreprocessor b))
- parserlessPreprocessor :: SpecPreprocessor b -> SpecPreprocessorWithArgParser b
Documentation
describe :: forall (r :: EffectRow) a. Members '[Assertion :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => Text -> Sem r a -> Sem r a #
assert :: forall (r :: EffectRow). Member (Assertion :: (Type -> Type) -> Type -> Type) r => Text -> AssertionStatus -> Sem r () #
assertError :: forall (r :: EffectRow). Member (Assertion :: (Type -> Type) -> Type -> Type) r => Text -> Sem ((Error Text :: (Type -> Type) -> Type -> Type) ': r) () -> Sem r () #
data SQLDialect #
Instances
FromJSON SQLDialect | |
Defined in Napkin.Parse.Base parseJSON :: Value -> Parser SQLDialect # parseJSONList :: Value -> Parser [SQLDialect] # | |
Show SQLDialect | |
Defined in Napkin.Parse.Base showsPrec :: Int -> SQLDialect -> ShowS # show :: SQLDialect -> String # showList :: [SQLDialect] -> ShowS # | |
Eq SQLDialect | |
Defined in Napkin.Parse.Base (==) :: SQLDialect -> SQLDialect -> Bool # (/=) :: SQLDialect -> SQLDialect -> Bool # |
data AssertionStatus #
Instances
Assertion effects so we can skip past them in dry runs, and optionally throw exceptions or just collect them along the way for final reporting, etc..
getCurrentTime :: forall (effs :: EffectRow). Member (Time :: (Type -> Type) -> Type -> Type) effs => Sem effs UTCTime #
dropView :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => Ref Table -> MissingBehavior -> Cascade -> Sem r () #
assertM :: forall (r :: EffectRow). Member (Assertion :: (Type -> Type) -> Type -> Type) r => Text -> Sem r AssertionStatus -> Sem r () #
logInfo :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LText -> Sem effs () #
addDependency :: forall (r :: EffectRow). Member (Output ExtraDependencies :: (Type -> Type) -> Type -> Type) r => Ref Table -> Sem r () #
Add the given reference to list of dependency for the underlying region.
Later during interpretation, this will cause the given dependency to be forcefully considered upstream dependency within the enclosed region even though they were not seen in the parsed SQL.
getAnnotations :: forall {k} (b :: k) (r :: EffectRow). Member (AnnotateRead b :: (Type -> Type) -> Type -> Type) r => Ref Table -> Sem r TableAnnotations #
logError :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LText -> Sem effs () #
logDebug :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LText -> Sem effs () #
renderQuery :: forall (r :: EffectRow). Member (SqlRender :: (Type -> Type) -> Type -> Type) r => Query -> Sem r SqlText #
checkTableExists :: forall {k} (b :: k) (r :: EffectRow). Member (SqlRead b :: (Type -> Type) -> Type -> Type) r => Ref Table -> Sem r Bool #
renameTable :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => Ref Table -> Ref Table -> Sem r () #
newtype RandomToken #
type family Members (es :: [Effect]) (r :: EffectRow) where ... #
Makes constraints of functions that use multiple effects shorter by
translating single list of effects into multiple Member
constraints:
foo ::Members
'[Output
Int ,Output
Bool ,State
String ] r =>Sem
r ()
translates into:
foo :: (Member
(Output
Int) r ,Member
(Output
Bool) r ,Member
(State
String) r ) =>Sem
r ()
Since: polysemy-0.1.2.0
The Sem
monad handles computations of arbitrary extensible effects.
A value of type Sem r
describes a program with the capabilities of
r
. For best results, r
should always be kept polymorphic, but you can
add capabilities via the Member
constraint.
The value of the Sem
monad is that it allows you to write programs
against a set of effects without a predefined meaning, and provide that
meaning later. For example, unlike with mtl, you can decide to interpret an
Error
effect traditionally as an Either
, or instead
as (a significantly faster) IO
Exception
. These
interpretations (and others that you might add) may be used interchangeably
without needing to write any newtypes or Monad
instances. The only
change needed to swap interpretations is to change a call from
runError
to errorToIOFinal
.
The effect stack r
can contain arbitrary other monads inside of it. These
monads are lifted into effects via the Embed
effect. Monadic values can be
lifted into a Sem
via embed
.
Higher-order actions of another monad can be lifted into higher-order actions
of Sem
via the Final
effect, which is more powerful
than Embed
, but also less flexible to interpret.
A Sem
can be interpreted as a pure value (via run
) or as any
traditional Monad
(via runM
or runFinal
).
Each effect E
comes equipped with some interpreters of the form:
runE ::Sem
(E ': r) a ->Sem
r a
which is responsible for removing the effect E
from the effect stack. It
is the order in which you call the interpreters that determines the
monomorphic representation of the r
parameter.
Order of interpreters can be important - it determines behaviour of effects that manipulate state or change control flow. For example, when interpreting this action:
>>>
:{
example :: Members '[State String, Error String] r => Sem r String example = do put "start" let throwing, catching :: Members '[State String, Error String] r => Sem r String throwing = do modify (++"-throw") throw "error" get catching = do modify (++"-catch") get catch @String throwing (\ _ -> catching) :}
when handling Error
first, state is preserved after error
occurs:
>>>
:{
example & runError & fmap (either id id) & evalState "" & runM & (print =<<) :} "start-throw-catch"
while handling State
first discards state in such cases:
>>>
:{
example & evalState "" & runError & fmap (either id id) & runM & (print =<<) :} "start-catch"
A good rule of thumb is to handle effects which should have "global" behaviour over other effects later in the chain.
After all of your effects are handled, you'll be left with either
a
, a Sem
'[] a
, or a Sem
'[ Embed
m ] a
value, which can be consumed respectively by Sem
'[ Final
m ] arun
, runM
, and
runFinal
.
Examples
As an example of keeping r
polymorphic, we can consider the type
Member
(State
String) r =>Sem
r ()
to be a program with access to
get
::Sem
r Stringput
:: String ->Sem
r ()
methods.
By also adding a
Member
(Error
Bool) r
constraint on r
, we gain access to the
throw
:: Bool ->Sem
r acatch
::Sem
r a -> (Bool ->Sem
r a) ->Sem
r a
functions as well.
In this sense, a
constraint is
analogous to mtl's Member
(State
s) r
and should
be thought of as such. However, unlike mtl, a MonadState
s mSem
monad may have
an arbitrary number of the same effect.
For example, we can write a Sem
program which can output either
Int
s or Bool
s:
foo :: (Member
(Output
Int) r ,Member
(Output
Bool) r ) =>Sem
r () foo = dooutput
@Int 5output
True
Notice that we must use -XTypeApplications
to specify that we'd like to
use the (Output
Int
) effect.
Since: polysemy-0.1.2.0
Instances
Member (Embed IO) r => MonadIO (Sem r) | This instance will only lift |
Defined in Polysemy.Internal | |
Member NonDet r => Alternative (Sem r) | |
Applicative (Sem f) | |
Functor (Sem f) | |
Monad (Sem f) | |
Member NonDet r => MonadPlus (Sem r) | Since: polysemy-0.2.1.0 |
Member (Fail :: (Type -> Type) -> Type -> Type) r => MonadFail (Sem r) | Since: polysemy-1.1.0.0 |
Defined in Polysemy.Internal | |
Member Fixpoint r => MonadFix (Sem r) | |
Defined in Polysemy.Internal | |
Monoid a => Monoid (Sem f a) | Since: polysemy-1.6.0.0 |
Semigroup a => Semigroup (Sem f a) | Since: polysemy-1.6.0.0 |
class Member (t :: Effect) (r :: EffectRow) #
This class indicates that an effect must be present in the caller's stack. It is the main mechanism by which a program defines its effect dependencies.
membership'
Instances
Member t z => Member t (_1 ': z) | |
Defined in Polysemy.Internal.Union membership' :: ElemOf t (_1 ': z) | |
Member t (t ': z) | |
Defined in Polysemy.Internal.Union membership' :: ElemOf t (t ': z) |
executeExternalCommand :: forall (effs :: EffectRow). Members '[FatalError :: (Type -> Type) -> Type -> Type, External :: (Type -> Type) -> Type -> Type] effs => ExternalCommand -> Sem effs () #
logNotice :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LText -> Sem effs () #
logWarning :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LText -> Sem effs () #
logCritical :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LText -> Sem effs () #
logAlert :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LText -> Sem effs () #
logEmergency :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LText -> Sem effs () #
logDebug' :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LogItem -> LText -> Sem effs () #
logInfo' :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LogItem -> LText -> Sem effs () #
logNotice' :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LogItem -> LText -> Sem effs () #
logWarning' :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LogItem -> LText -> Sem effs () #
logError' :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LogItem -> LText -> Sem effs () #
logCritical' :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LogItem -> LText -> Sem effs () #
logAlert' :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LogItem -> LText -> Sem effs () #
logEmergency' :: forall (effs :: EffectRow). Member (Log :: (Type -> Type) -> Type -> Type) effs => LogItem -> LText -> Sem effs () #
pattern FailureWithMessage :: Text -> AssertionStatus #
assert' :: forall (r :: EffectRow). Member (Assertion :: (Type -> Type) -> Type -> Type) r => AssertionGroup -> AssertionSeverity -> Text -> AssertionStatus -> Sem r () #
Assertions are run-time checks based on actual results that may be returned by various operations. Dry runs may ignore these failures, but they're respected in real operations.
assertTrue :: forall (r :: EffectRow). Member (Assertion :: (Type -> Type) -> Type -> Type) r => Text -> Bool -> Sem r () #
assertEquals :: forall a (r :: EffectRow). (Eq a, Member (Assertion :: (Type -> Type) -> Type -> Type) r) => Text -> a -> a -> Sem r () #
assertTrueWith :: forall (r :: EffectRow). Member (Assertion :: (Type -> Type) -> Type -> Type) r => Text -> Bool -> Text -> Sem r () #
assertTrueWithM :: forall (r :: EffectRow). Member (Assertion :: (Type -> Type) -> Type -> Type) r => Text -> Bool -> Sem r Text -> Sem r () #
failedAssertion :: forall (r :: EffectRow). Member (Assertion :: (Type -> Type) -> Type -> Type) r => Text -> Sem r () #
warnOnly :: forall (r :: EffectRow) a. Member (Assertion :: (Type -> Type) -> Type -> Type) r => Sem r a -> Sem r a #
describe' :: forall (r :: EffectRow) a. Members '[Assertion :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => [Text] -> Sem r a -> Sem r a #
data SqlRead (b :: k) (m :: k1) a #
Instances
(IsRenderable SExp b, IsRenderable Query b, IsRenderable Text b) => ToDumpItem (b :: k) (SqlRead b :: (Type -> Type) -> Type -> Type) | |
GShow (SqlRead b m :: Type -> Type) | |
Defined in Napkin.Run.Effects.Languages.SqlRead gshowsPrec :: Int -> SqlRead b m a -> ShowS # | |
Show (SqlRead b m a) | |
Eq (SqlRead b m a) | |
runQuery :: forall {k} (b :: k) (r :: EffectRow). Member (SqlRead b :: (Type -> Type) -> Type -> Type) r => Query -> Sem r [Map Text Value] #
getTableKind :: forall {k} (b :: k) (r :: EffectRow). Member (SqlRead b :: (Type -> Type) -> Type -> Type) r => Ref Table -> Sem r TableKind #
runQuerySingleAnswer :: forall {k} (b :: k) a (r :: EffectRow). (Val a, Member (SqlRead b :: (Type -> Type) -> Type -> Type) r) => Query -> Sem r (Maybe a) #
Run a query and pull out the first column from its first row. Meant for queries that return a single result.
getRelationSchema :: forall {k} (b :: k) (r :: EffectRow). Members '[SqlRead b :: (Type -> Type) -> Type -> Type, Input TemporaryTableName :: (Type -> Type) -> Type -> Type] r => Relation -> Sem r [BackendSchemaField b] #
Instances
GShow (SqlRender a :: Type -> Type) | |
Defined in Napkin.Run.Effects.Languages.SqlRender gshowsPrec :: Int -> SqlRender a a0 -> ShowS # | |
CacheableEffect (SqlRender :: k -> Type -> Type) SqlRenderCacheKey | |
Defined in Napkin.Run.Effects.Languages.SqlRender | |
Show (SqlRender a b) | |
Eq (SqlRender m a) | |
Ord (SqlRender m a) | |
Defined in Napkin.Run.Effects.Languages.SqlRender compare :: SqlRender m a -> SqlRender m a -> Ordering # (<) :: SqlRender m a -> SqlRender m a -> Bool # (<=) :: SqlRender m a -> SqlRender m a -> Bool # (>) :: SqlRender m a -> SqlRender m a -> Bool # (>=) :: SqlRender m a -> SqlRender m a -> Bool # |
renderSExp :: forall (r :: EffectRow). Member (SqlRender :: (Type -> Type) -> Type -> Type) r => SExp -> Sem r SqlText #
Instances
GShow (SqlParse a :: Type -> Type) | |
Defined in Napkin.Run.Effects.Languages.SqlParse gshowsPrec :: Int -> SqlParse a a0 -> ShowS # | |
CacheableEffect (SqlParse :: k -> Type -> Type) SqlParseCacheKey | |
Defined in Napkin.Run.Effects.Languages.SqlParse | |
Show (SqlParse m a) | |
Eq (SqlParse m a) | |
Ord (SqlParse m a) | |
Defined in Napkin.Run.Effects.Languages.SqlParse |
parseSqlQuery :: forall (r :: EffectRow). Members '[SqlParse :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type] r => SourceLocation -> Text -> Sem r Query #
parseSqlExp :: forall (r :: EffectRow). Members '[SqlParse :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type] r => SourceLocation -> Text -> Sem r SExp #
parseStatements :: forall (r :: EffectRow) a. (Members '[SqlParse :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type] r, Stateable a) => SourceLocation -> Text -> Sem r [a] #
overrideDialect :: forall (r :: EffectRow) a. Member (Reader SQLDialect) r => SQLDialect -> Sem r a -> Sem r a #
Effects that deal with local files
Instances
CacheableEffect (LoadQuery :: k -> Type -> Type) LoadQueryCacheKey | |
Defined in Napkin.Run.Effects.Languages.LoadQuery | |
Eq (LoadQuery m a) | |
Ord (LoadQuery m a) | |
Defined in Napkin.Run.Effects.Languages.LoadQuery compare :: LoadQuery m a -> LoadQuery m a -> Ordering # (<) :: LoadQuery m a -> LoadQuery m a -> Bool # (<=) :: LoadQuery m a -> LoadQuery m a -> Bool # (>) :: LoadQuery m a -> LoadQuery m a -> Bool # (>=) :: LoadQuery m a -> LoadQuery m a -> Bool # |
newtype LoadQueryError #
Instances
Show LoadQueryError | |
Defined in Napkin.Run.Effects.Languages.LoadQuery showsPrec :: Int -> LoadQueryError -> ShowS # show :: LoadQueryError -> String # showList :: [LoadQueryError] -> ShowS # | |
Eq LoadQueryError | |
Defined in Napkin.Run.Effects.Languages.LoadQuery (==) :: LoadQueryError -> LoadQueryError -> Bool # (/=) :: LoadQueryError -> LoadQueryError -> Bool # |
loadQueryFromFile :: forall (r :: EffectRow). Member (LoadQuery :: (Type -> Type) -> Type -> Type) r => FilePath -> SqlTemplateVariables -> Sem r (Either LoadQueryError Text) #
loadSqlFile :: forall (r :: EffectRow). Members '[SqlParse :: (Type -> Type) -> Type -> Type, LoadQuery :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type] r => FilePath -> SqlTemplateVariables -> Sem r Query #
requiredArgDef :: ToJSON a => a -> SpecProgramArgumentDescription -> SpecProgramArgumentDefinition #
announceMetaArguments :: SpecProgramArguments -> b -> (SpecProgramArguments, b) #
noMetaArguments :: b -> (SpecProgramArguments, b) #
Instances
(Show (BackendTableMeta b), Show (BackendViewMeta b), Show (BackendMaterializedViewMeta b), IsRenderable Query b, IsRenderable Statement b, IsRenderable SExp b, IsRenderable UpdateQuery b, IsRenderable Text b, Default (BackendTableMeta b), Default (BackendViewMeta b), MaybeDefault (YamlBackendMaterializedViewMeta b), Eq (BackendTableMeta b), Eq (BackendViewMeta b), Eq (YamlBackendMaterializedViewMeta b)) => ToDumpItem (b :: Type) (SqlWrite b :: (Type -> Type) -> Type -> Type) | |
(Show (BackendTableMeta bk), Show (BackendViewMeta bk), Show (BackendMaterializedViewMeta bk)) => GShow (SqlWrite bk a :: Type -> Type) | |
Defined in Napkin.Run.Effects.Languages.SqlWrite gshowsPrec :: Int -> SqlWrite bk a a0 -> ShowS # | |
(Show (BackendTableMeta bk), Show (BackendViewMeta bk), Show (BackendMaterializedViewMeta bk)) => Show (SqlWrite bk a b) | |
(Eq (BackendTableMeta bk), Eq (BackendViewMeta bk), Eq (BackendMaterializedViewMeta bk)) => Eq (SqlWrite bk a b) | |
data MissingBehavior #
Instances
Show MissingBehavior | |
Defined in Napkin.Run.Effects.Languages.SqlWrite showsPrec :: Int -> MissingBehavior -> ShowS # show :: MissingBehavior -> String # showList :: [MissingBehavior] -> ShowS # | |
Eq MissingBehavior | |
Defined in Napkin.Run.Effects.Languages.SqlWrite (==) :: MissingBehavior -> MissingBehavior -> Bool # (/=) :: MissingBehavior -> MissingBehavior -> Bool # |
Instances
createTableAsWithMeta :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => BackendTableMeta b -> Ref Table -> Query -> Sem r () #
createViewAsWithMeta :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => BackendViewMeta b -> Ref Table -> Query -> Sem r () #
createMaterializedViewAsWithMeta :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => BackendMaterializedViewMeta b -> Ref Table -> Query -> Sem r () #
insertIntoQuery :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => Ref Table -> Query -> Sem r () #
updateTable :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => UpdateQuery -> Sem r () #
copyTable :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => Ref Table -> Ref Table -> TableWriteStrategy -> Sem r () #
dropTable :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => Ref Table -> MissingBehavior -> Cascade -> Sem r () #
dropMaterializedView :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => Ref Table -> MissingBehavior -> Cascade -> Sem r () #
deleteFrom :: forall b (r :: EffectRow). Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r => Ref Table -> SExp -> Sem r () #
createTableAs :: forall b (r :: EffectRow). (Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r, Default (BackendTableMeta b)) => Ref Table -> Query -> Sem r () #
createViewAs :: forall b (r :: EffectRow). (Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r, Default (BackendViewMeta b)) => Ref Table -> Query -> Sem r () #
createMaterializedViewAs :: forall b (r :: EffectRow). (Member (SqlWrite b :: (Type -> Type) -> Type -> Type) r, Default (BackendMaterializedViewMeta b)) => Ref Table -> Query -> Sem r () #
newtype TableMemos #
Instances
Monoid TableMemos | |
Defined in Napkin.Run.Effects.Languages.TableSpec mempty :: TableMemos # mappend :: TableMemos -> TableMemos -> TableMemos # mconcat :: [TableMemos] -> TableMemos # | |
Semigroup TableMemos | |
Defined in Napkin.Run.Effects.Languages.TableSpec (<>) :: TableMemos -> TableMemos -> TableMemos # sconcat :: NonEmpty TableMemos -> TableMemos # stimes :: Integral b => b -> TableMemos -> TableMemos # | |
ToDumpItem (b :: k) (Reader TableMemos) | |
Defined in Napkin.Run.Effects.Interceptors.LogProgram.Types toDumpItem :: forall (r :: EffectRow) x. Reader TableMemos (Sem r) x -> DumpItem b # |
newtype MetaArguments #
Instances
Monoid MetaArguments | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec mempty :: MetaArguments # mappend :: MetaArguments -> MetaArguments -> MetaArguments # mconcat :: [MetaArguments] -> MetaArguments # | |||||
Semigroup MetaArguments | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec (<>) :: MetaArguments -> MetaArguments -> MetaArguments # sconcat :: NonEmpty MetaArguments -> MetaArguments # stimes :: Integral b => b -> MetaArguments -> MetaArguments # | |||||
IsList MetaArguments | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec
fromList :: [Item MetaArguments] -> MetaArguments # fromListN :: Int -> [Item MetaArguments] -> MetaArguments # toList :: MetaArguments -> [Item MetaArguments] # | |||||
Show MetaArguments | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec showsPrec :: Int -> MetaArguments -> ShowS # show :: MetaArguments -> String # showList :: [MetaArguments] -> ShowS # | |||||
Eq MetaArguments | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec (==) :: MetaArguments -> MetaArguments -> Bool # (/=) :: MetaArguments -> MetaArguments -> Bool # | |||||
type Item MetaArguments | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec |
newtype TargetName #
newtype HiddenArtifacts #
HiddenArtifacts (Set (Ref Table)) |
Instances
Default HiddenArtifacts | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec def :: HiddenArtifacts # | |||||
Monoid HiddenArtifacts | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec mappend :: HiddenArtifacts -> HiddenArtifacts -> HiddenArtifacts # mconcat :: [HiddenArtifacts] -> HiddenArtifacts # | |||||
Semigroup HiddenArtifacts | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec (<>) :: HiddenArtifacts -> HiddenArtifacts -> HiddenArtifacts # sconcat :: NonEmpty HiddenArtifacts -> HiddenArtifacts # stimes :: Integral b => b -> HiddenArtifacts -> HiddenArtifacts # | |||||
IsList HiddenArtifacts | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec
fromList :: [Item HiddenArtifacts] -> HiddenArtifacts # fromListN :: Int -> [Item HiddenArtifacts] -> HiddenArtifacts # toList :: HiddenArtifacts -> [Item HiddenArtifacts] # | |||||
Show HiddenArtifacts | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec showsPrec :: Int -> HiddenArtifacts -> ShowS # show :: HiddenArtifacts -> String # showList :: [HiddenArtifacts] -> ShowS # | |||||
Eq HiddenArtifacts | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec (==) :: HiddenArtifacts -> HiddenArtifacts -> Bool # (/=) :: HiddenArtifacts -> HiddenArtifacts -> Bool # | |||||
type Item HiddenArtifacts | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec |
newtype HiddenDependencies #
Instances
Default HiddenDependencies | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec | |||||
Monoid HiddenDependencies | |||||
Semigroup HiddenDependencies | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec (<>) :: HiddenDependencies -> HiddenDependencies -> HiddenDependencies # sconcat :: NonEmpty HiddenDependencies -> HiddenDependencies # stimes :: Integral b => b -> HiddenDependencies -> HiddenDependencies # | |||||
IsList HiddenDependencies | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec
fromList :: [Item HiddenDependencies] -> HiddenDependencies # fromListN :: Int -> [Item HiddenDependencies] -> HiddenDependencies # toList :: HiddenDependencies -> [Item HiddenDependencies] # | |||||
Show HiddenDependencies | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec showsPrec :: Int -> HiddenDependencies -> ShowS # show :: HiddenDependencies -> String # showList :: [HiddenDependencies] -> ShowS # | |||||
Eq HiddenDependencies | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec (==) :: HiddenDependencies -> HiddenDependencies -> Bool # (/=) :: HiddenDependencies -> HiddenDependencies -> Bool # | |||||
type Item HiddenDependencies | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec |
newtype ExtraDependencies #
ExtraDependencies (Set (Ref Table)) |
Instances
Default ExtraDependencies | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec | |||||
Monoid ExtraDependencies | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec | |||||
Semigroup ExtraDependencies | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec (<>) :: ExtraDependencies -> ExtraDependencies -> ExtraDependencies # sconcat :: NonEmpty ExtraDependencies -> ExtraDependencies # stimes :: Integral b => b -> ExtraDependencies -> ExtraDependencies # | |||||
IsList ExtraDependencies | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec
fromList :: [Item ExtraDependencies] -> ExtraDependencies # fromListN :: Int -> [Item ExtraDependencies] -> ExtraDependencies # toList :: ExtraDependencies -> [Item ExtraDependencies] # | |||||
Show ExtraDependencies | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec showsPrec :: Int -> ExtraDependencies -> ShowS # show :: ExtraDependencies -> String # showList :: [ExtraDependencies] -> ShowS # | |||||
Eq ExtraDependencies | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec (==) :: ExtraDependencies -> ExtraDependencies -> Bool # (/=) :: ExtraDependencies -> ExtraDependencies -> Bool # | |||||
type Item ExtraDependencies | |||||
Defined in Napkin.Run.Effects.Languages.TableSpec |
renameReferences :: forall (r :: EffectRow) a. Member (Reader QueryTransformer) r => (Ref Table -> Ref Table) -> Sem r a -> Sem r a #
Apply given table name renamer to every single reference occurrence everywhere.
If you want to target only certain tables, make sure the function you provide here does the filtering internally.
applyTransformer :: forall (r :: EffectRow) a. Member (Reader QueryTransformer) r => QueryTransformerUnit -> Sem r a -> Sem r a #
Comprehensively apply the given transformer around the given region.
hideDependencies :: forall a (r :: EffectRow). Member (Reader HiddenDependencies) r => Set (Ref Table) -> Sem r a -> Sem r a #
Add the given dependencies to the hide list around the given region.
Later during interpretation, this will cause the given dependencies to not be considered upstream dependencies within the enclosed region.
hideDependency :: forall a (r :: EffectRow). Member (Reader HiddenDependencies) r => Ref Table -> Sem r a -> Sem r a #
Add the given dependency to the hide list around the given region.
Later during interpretation, this will cause the given dependency to not be considered upstream dependency within the enclosed region.
hideArtifact :: forall a (r :: EffectRow). Member (Reader HiddenArtifacts) r => Ref Table -> Sem r a -> Sem r a #
Add the given artifact to the hide list around the given region.
Later during interpretation, this will cause the given artifact to not be reported to the tablespec within the enclosed region.
addDependencies :: forall (r :: EffectRow). Member (Output ExtraDependencies :: (Type -> Type) -> Type -> Type) r => Set (Ref Table) -> Sem r () #
Add the given references to list of dependencies for the underlying region.
Later during interpretation, this will cause the given dependencies to be forcefully considered upstream dependencies within the enclosed region even though they were not seen in the parsed SQL.
overrideTarget :: forall a (r :: EffectRow). Member (Reader TargetName) r => Ref Table -> Sem r a -> Sem r a #
insertQueryIntoTarget :: forall b (effs :: EffectRow). Members '[SqlWrite b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => Query -> Sem effs () #
deleteFromTarget :: forall b (effs :: EffectRow). Members '[SqlWrite b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => SExp -> Sem effs () #
updateTarget :: forall b (effs :: EffectRow). Members '[SqlWrite b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => (Ref Relation -> U ()) -> Sem effs () #
data AnnotateRead (b :: k) (m :: k1) a #
Instances
ToDumpItem (b :: k) (AnnotateRead b :: (Type -> Type) -> Type -> Type) | |
Defined in Napkin.Run.Effects.Interceptors.LogProgram.Types toDumpItem :: forall (r :: EffectRow) x. AnnotateRead b (Sem r) x -> DumpItem b # | |
GShow (AnnotateRead bk a :: Type -> Type) | |
Defined in Napkin.Run.Effects.Languages.AnnotateRead gshowsPrec :: Int -> AnnotateRead bk a a0 -> ShowS # | |
Show (AnnotateRead bk a b) | |
Defined in Napkin.Run.Effects.Languages.AnnotateRead showsPrec :: Int -> AnnotateRead bk a b -> ShowS # show :: AnnotateRead bk a b -> String # showList :: [AnnotateRead bk a b] -> ShowS # | |
Eq (AnnotateRead bk a b) | |
Defined in Napkin.Run.Effects.Languages.AnnotateRead (==) :: AnnotateRead bk a b -> AnnotateRead bk a b -> Bool # (/=) :: AnnotateRead bk a b -> AnnotateRead bk a b -> Bool # |
data TableAnnotations #
Instances
Generic TableAnnotations | |||||
Defined in Napkin.Run.Effects.Languages.AnnotateRead
from :: TableAnnotations -> Rep TableAnnotations x # to :: Rep TableAnnotations x -> TableAnnotations # | |||||
type Rep TableAnnotations | |||||
Defined in Napkin.Run.Effects.Languages.AnnotateRead type Rep TableAnnotations = D1 ('MetaData "TableAnnotations" "Napkin.Run.Effects.Languages.AnnotateRead" "napkin-spec-2.0.0-7NH5JHRFo7V8BQP5NCfMo1" 'False) (C1 ('MetaCons "TableAnnotations" 'PrefixI 'True) (S1 ('MetaSel ('Just "tableAnnotation") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "columnsAnnotations") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ColumnsAnnotations))) |
getTargetAnnotations :: forall {k} (b :: k) (effs :: EffectRow). Members '[AnnotateRead b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => Sem effs TableAnnotations #
data AnnotateWrite (b :: k) (m :: k1) a #
Instances
ToDumpItem (b :: k) (AnnotateWrite b :: (Type -> Type) -> Type -> Type) | |
Defined in Napkin.Run.Effects.Interceptors.LogProgram.Types toDumpItem :: forall (r :: EffectRow) x. AnnotateWrite b (Sem r) x -> DumpItem b # | |
GShow (AnnotateWrite bk a :: Type -> Type) | |
Defined in Napkin.Run.Effects.Languages.AnnotateWrite gshowsPrec :: Int -> AnnotateWrite bk a a0 -> ShowS # | |
Show (AnnotateWrite bk a b) | |
Defined in Napkin.Run.Effects.Languages.AnnotateWrite showsPrec :: Int -> AnnotateWrite bk a b -> ShowS # show :: AnnotateWrite bk a b -> String # showList :: [AnnotateWrite bk a b] -> ShowS # | |
Eq (AnnotateWrite bk a b) | |
Defined in Napkin.Run.Effects.Languages.AnnotateWrite (==) :: AnnotateWrite bk a b -> AnnotateWrite bk a b -> Bool # (/=) :: AnnotateWrite bk a b -> AnnotateWrite bk a b -> Bool # |
annotateTable :: forall {k} (b :: k) (r :: EffectRow). Member (AnnotateWrite b :: (Type -> Type) -> Type -> Type) r => Ref Table -> Text -> Sem r () #
annotateColumns :: forall {k} (b :: k) (r :: EffectRow). Member (AnnotateWrite b :: (Type -> Type) -> Type -> Type) r => Ref Table -> ColumnsAnnotations -> Sem r () #
annotateColumn :: forall {k} (b :: k) (effs :: EffectRow). Member (AnnotateWrite b :: (Type -> Type) -> Type -> Type) effs => Ref Table -> Ref SExp -> Text -> Sem effs () #
annotateTargetTable :: forall {k} (b :: k) (effs :: EffectRow). Members '[AnnotateWrite b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => Text -> Sem effs () #
annotateTargetColumns :: forall {k} (b :: k) (effs :: EffectRow). Members '[AnnotateWrite b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => ColumnsAnnotations -> Sem effs () #
annotateTargetColumn :: forall {k} (b :: k) (effs :: EffectRow). Members '[AnnotateWrite b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => Ref SExp -> Text -> Sem effs () #
data RecreateTable b (m :: k) a #
Instances
(Show (BackendTableMeta b), Show (BackendViewMeta b), Show (BackendMaterializedViewMeta b)) => GShow (RecreateTable b a :: Type -> Type) | |
Defined in Napkin.Run.Effects.Languages.Recreate gshowsPrec :: Int -> RecreateTable b a a0 -> ShowS # | |
(Show (BackendTableMeta b), Show (BackendViewMeta b), Show (BackendMaterializedViewMeta b)) => Show (RecreateTable b a c) | |
Defined in Napkin.Run.Effects.Languages.Recreate showsPrec :: Int -> RecreateTable b a c -> ShowS # show :: RecreateTable b a c -> String # showList :: [RecreateTable b a c] -> ShowS # |
recreateTableAs :: forall b (r :: EffectRow). Member (RecreateTable b :: (Type -> Type) -> Type -> Type) r => BackendTableMeta b -> Ref Table -> NonEmpty Query -> Sem r () #
recreateViewAs :: forall b (r :: EffectRow). Member (RecreateTable b :: (Type -> Type) -> Type -> Type) r => BackendViewMeta b -> Ref Table -> Query -> Sem r () #
recreateMaterializedViewAs :: forall b (r :: EffectRow). Member (RecreateTable b :: (Type -> Type) -> Type -> Type) r => BackendMaterializedViewMeta b -> Ref Table -> Query -> Sem r () #
recreateTargetTable :: forall b (effs :: EffectRow). Members '[RecreateTable b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => BackendTableMeta b -> NonEmpty Query -> Sem effs () #
recreateTableStatement :: forall b (effs :: EffectRow). Members '[RecreateTable b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => BackendTableMeta b -> CreateTableDDL -> [InsertStatement] -> Sem effs () #
recreateTargetView :: forall b (effs :: EffectRow). Members '[RecreateTable b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => BackendViewMeta b -> Query -> Sem effs () #
recreateTargetMaterializedView :: forall b (effs :: EffectRow). Members '[RecreateTable b :: (Type -> Type) -> Type -> Type, Reader TargetName] effs => BackendMaterializedViewMeta b -> Query -> Sem effs () #
askTextArgDefault :: forall (r :: EffectRow). Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => Text -> Text -> Sem r Text #
askTextArg :: forall (r :: EffectRow). Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => Text -> Sem r Text #
askTextArgMb :: forall (r :: EffectRow). Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => Text -> Sem r (Maybe Text) #
askBoolArgDefault :: forall (r :: EffectRow). Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => Bool -> Text -> Sem r Bool #
askBoolArg :: forall (r :: EffectRow). Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => Text -> Sem r Bool #
askBoolArgMb :: forall (r :: EffectRow). Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => Text -> Sem r (Maybe Bool) #
askNumArgDefault :: forall (r :: EffectRow). Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => Scientific -> Text -> Sem r Scientific #
askNumArg :: forall (r :: EffectRow). Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => Text -> Sem r Scientific #
askNumArgMb :: forall (r :: EffectRow). Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => Text -> Sem r (Maybe Scientific) #
askArg :: forall a (r :: EffectRow). (FromJSON a, Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r) => Text -> Sem r a #
askArgMb :: forall a (r :: EffectRow). (FromJSON a, Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r) => Text -> Sem r (Maybe a) #
withTypedArg :: forall a b (r :: EffectRow). (Members '[Input MetaArguments :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type] r, FromJSON a, Typeable a) => (a -> Sem r b) -> Sem r b #
class RunBackendEffect b where #
runBackendEffectReal, runBackendEffectFake, interceptBackendEffectDiscoverDependencies, interceptBackendEffectApplyQueryTransformer
runBackendEffectReal :: forall (m :: Type -> Type) (r :: EffectRow) a. (Members '[FatalError :: (Type -> Type) -> Type -> Type, Embed m] r, MonadNapkin b m, SqlIO m, LocalQueryStats b m) => BackendConn b -> Sem (BackendSpecificEffect b ': r) a -> Sem r a #
runBackendEffectFake :: forall (r :: EffectRow) a. Members '[Reader HiddenDependencies, State IState :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type] r => Sem (BackendSpecificEffect b ': r) a -> Sem r a #
interceptBackendEffectDiscoverDependencies :: forall (r :: EffectRow) a. Members '[Input (Transformed HiddenDependencies) :: (Type -> Type) -> Type -> Type, Output Dependencies :: (Type -> Type) -> Type -> Type, BackendSpecificEffect b] r => Sem r a -> Sem r a #
interceptBackendEffectApplyQueryTransformer :: forall (r :: EffectRow) a. Members '[Output ExtraDependencies :: (Type -> Type) -> Type -> Type, Reader QueryTransformer, BackendSpecificEffect b] r => Sem r a -> Sem r a #
backendDependencyValidator :: Proxy b -> [(SpecDependency -> Ref Table) -> SpecsDepsTables -> [WithSpecTable Text]] #
default backendDependencyValidator :: Proxy b -> [(SpecDependency -> Ref Table) -> SpecsDepsTables -> [WithSpecTable Text]] #
newtype SpecProgramWithArgParser b #
newtype HookProgramWithArgParser b #
type SpecProgram b = SpecProgram' b () #
type PureGlobalHookProgram b = PureGlobalHookProgram' b () #
type PureGlobalHookProgram' b a = Sem (PureGlobalHookProgramEffects b) a #
type IOGlobalHookProgram b = IOGlobalHookProgram' b () #
type IOGlobalHookProgram' b a = Sem (IOGlobalHookProgramEffects b) a #
type HookProgram b = HookProgram' b () #
Hooks have different capabilities than specs
type HookProgram' b a = Sem (TableHookProgramEffects b) a #
Programs packaged up for use in Specs. Intended for use in providing introspectable CustomCreate actions in specs.
type SpecProgram' b a = Sem (SpecProgramEffects b) a #
parserlessHook :: HookProgram b -> HookProgramWithArgParser b #
parserlessSpec :: SpecProgram b -> SpecProgramWithArgParser b #
newtype SpecPreprocessorWithArgParser b #