Safe Haskell | None |
---|---|
Language | GHC2021 |
Synopsis
- data IncludeUnmanagedTables
- data ApplyQueryTransformers
- type TableSpecsAsDependencyGraph b = (ReifiesBackend b, MustacheBackend b, RunBackendEffect b, DumpBackendRequirements b)
- allSpecsDeps :: TableSpecsAsDependencyGraph b => RuntimeEnv -> RawInterpretedSpec b -> IO (Either (NonEmpty (SpecTableName, NapkinEffectError)) (SpecsDeps, Map SpecTableName (ProgramDependenciesAndQueries b)))
- specDeps :: RawInterpretedSpec b -> [(SpecTableName, ProgramDependenciesAndQueries b)] -> SpecsDeps
- allSpecsDepsDAG :: TableSpecsAsDependencyGraph b => ApplyQueryTransformers -> RuntimeEnv -> RawInterpretedSpec b -> IO (Either (NonEmpty (SpecTableName, NapkinEffectError)) [(SpecTableName, ProgramDependenciesAndQueries b)])
- toDependency :: Specs b -> Ref Table -> SpecDependency
- tableSpecsAsDependencyGraph :: Specs b -> IncludeUnmanagedTables -> SpecsDeps -> SpecDepGraph
- toSpecName :: SpecDependency -> SpecTableName
- unmanagedInputTables :: ValidatedInterpretedSpec b -> Set SpecTableName -> Set SpecTableName
- managedInputTables :: ValidatedInterpretedSpec b -> Set SpecTableName -> Set SpecTableName
- findCycles :: Specs b -> SpecsDeps -> [[SpecTableName]]
- tableDownstream :: SpecDepGraph -> Set SpecTableName -> Set SpecTableName
- tableUpstream :: SpecDepGraph -> Set SpecTableName -> Set SpecTableName
- matchGraphTables :: SpecDepGraph -> (SpecTableName -> Bool) -> Set SpecTableName
Documentation
data IncludeUnmanagedTables #
Instances
Show IncludeUnmanagedTables # | |
Defined in Napkin.Spec.Graph showsPrec :: Int -> IncludeUnmanagedTables -> ShowS # show :: IncludeUnmanagedTables -> String # showList :: [IncludeUnmanagedTables] -> ShowS # | |
Eq IncludeUnmanagedTables # | |
Defined in Napkin.Spec.Graph |
data ApplyQueryTransformers #
ApplyQueryTransformers | ApplyQueryTransformers is not used (as unmanaged tables spec names are lost, and they are needed for table selectors), but is possible to use them to construct DAG graph. |
NotApplyTblRenames | Useful for dump command, so query transformers are applied to dumped queries |
NotApplyQueryTransformers | Used for run command where we just dependencies discover is needed, so transformers are not needed at all |
type TableSpecsAsDependencyGraph b = (ReifiesBackend b, MustacheBackend b, RunBackendEffect b, DumpBackendRequirements b) #
allSpecsDeps :: TableSpecsAsDependencyGraph b => RuntimeEnv -> RawInterpretedSpec b -> IO (Either (NonEmpty (SpecTableName, NapkinEffectError)) (SpecsDeps, Map SpecTableName (ProgramDependenciesAndQueries b))) #
specDeps :: RawInterpretedSpec b -> [(SpecTableName, ProgramDependenciesAndQueries b)] -> SpecsDeps #
allSpecsDepsDAG :: TableSpecsAsDependencyGraph b => ApplyQueryTransformers -> RuntimeEnv -> RawInterpretedSpec b -> IO (Either (NonEmpty (SpecTableName, NapkinEffectError)) [(SpecTableName, ProgramDependenciesAndQueries b)]) #
toDependency :: Specs b -> Ref Table -> SpecDependency #
This is what we want to use when packing a SpecDependency. programDependenciesAndQueries will return a Dependencies :: Set (Ref Table), and without more information it is impossible to tell if these are managed or unmanaged. However, taken with a Specs this can be deduced. If the packed table ref is not a member of the specsTables found in the Specs then it is UnManaged, and should be marked as such. Otherwise it is managed and can safely be packed using Managed . SpecTableName. Use of constructor is necessary here.
tableSpecsAsDependencyGraph :: Specs b -> IncludeUnmanagedTables -> SpecsDeps -> SpecDepGraph #
unmanagedInputTables :: ValidatedInterpretedSpec b -> Set SpecTableName -> Set SpecTableName #
unmanaged tables that will be used as an input during this run
managedInputTables :: ValidatedInterpretedSpec b -> Set SpecTableName -> Set SpecTableName #
managed tables that will be used as an input during this run, but will not be updated
findCycles :: Specs b -> SpecsDeps -> [[SpecTableName]] #
tableDownstream :: SpecDepGraph -> Set SpecTableName -> Set SpecTableName #
tableUpstream :: SpecDepGraph -> Set SpecTableName -> Set SpecTableName #
matchGraphTables :: SpecDepGraph -> (SpecTableName -> Bool) -> Set SpecTableName #