Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- splitIfUnionBy :: forall effs a. Members [SqlWrite, RecreateTable] effs => Int -> Sem effs a -> Sem effs a
- incrementalInsertByPK :: forall effs. Members [SqlWrite, SqlRead, Time, Reader TargetName, Reader HiddenDependencies, RecreateTable] effs => (Day -> Sem effs Query) -> SExp -> Day -> Integer -> Sem effs ()
- incrementalInsertByPKQuery :: (Day -> Sem r Query) -> SExp -> Integer -> Ref Table -> Day -> Sem r Query
- incrementalByTimeRawSql :: Members [SqlWrite, SqlRead, Time, Reader TargetName, Reader HiddenDependencies, RecreateTable, SqlParse, SqlRender, LoadQuery, FatalError, Reader ExtraDependencies, Input RandomToken, Input MetaArguments, Reader DynamicMeta, Log] r => FilePath -> SqlTemplateVariables -> SExp -> Day -> Integer -> Sem r ()
- incrementalByTimeCreateAction :: forall effs. Members [SqlWrite, SqlRead, Time, Reader TargetName, Input MetaArguments, Reader HiddenDependencies, Input RandomToken, RecreateTable, Reader DynamicMeta, FatalError, Log] effs => (Day -> Sem effs Query) -> Day -> (Day -> SExp) -> Integer -> Sem effs ()
- incrementalInsert :: forall effs. Members [SqlWrite, SqlRead, Input RandomToken, Reader TargetName, Reader HiddenDependencies, Reader DynamicMeta] effs => (Day -> Sem effs Query) -> (Day -> SExp) -> Integer -> Day -> Sem effs ()
- copyData :: forall effs. Members '[SqlWrite] effs => Ref Table -> Ref Table -> Sem effs ()
- loadSqlFileWithCutoff :: forall effs. Members [SqlParse, SqlRender, FatalError, LoadQuery] effs => FilePath -> SqlTemplateVariables -> Day -> Sem effs Query
- longToWideAuto :: forall effs. Members [SqlWrite, SqlRead, Input RandomToken, Reader HiddenDependencies, Reader TargetName, RecreateTable] effs => Ref Table -> (SExp -> SExp) -> [Alias SExp] -> SExp -> SExp -> (Value -> Ref SExp) -> SpecTarget -> Sem effs ()
- combineTables :: forall effs. Members '[SqlWrite, SqlRead, Reader ExtraDependencies, Reader TargetName, RecreateTable] effs => SpecTarget -> (Query -> Query) -> [Relation] -> Sem effs ()
- externalCreate :: Members [FatalError, SqlRead, ExternalCreate, Reader TargetName, Reader ExtraDependencies, Input MetaArguments] r => Set (Ref Table) -> Text -> [Text] -> Sem r ()
- createRawSql :: forall r. Members [FatalError, Reader TargetName, Reader ExtraDependencies, Reader HiddenDependencies, Reader QueryTransformer, RecreateTable, LoadQuery, SqlParse, SqlWrite] r => FilePath -> SqlTemplateVariables -> ExtraDependencies -> HiddenDependencies -> SpecTarget -> Sem r ()
- recreateTarget :: Members [RecreateTable, Reader TargetName, SqlWrite] effs => SpecTarget -> NonEmpty Query -> Sem effs ()
- createWithQuery :: forall r. Members [FatalError, Reader TargetName, Reader ExtraDependencies, Reader HiddenDependencies, Reader QueryTransformer, RecreateTable, LoadQuery, SqlParse, SqlWrite] r => NonEmpty Query -> SpecTarget -> ExtraDependencies -> HiddenDependencies -> Sem r ()
Documentation
splitIfUnionBy :: forall effs a. Members [SqlWrite, RecreateTable] effs => Int -> Sem effs a -> Sem effs a #
Intercept CreateTableAs calls and try to split queries into CreateTableAs + multiple InsertIntoQuery when query contains unions
incrementalInsertByPKQuery :: (Day -> Sem r Query) -> SExp -> Integer -> Ref Table -> Day -> Sem r Query #
:: Members [SqlWrite, SqlRead, Time, Reader TargetName, Reader HiddenDependencies, RecreateTable, SqlParse, SqlRender, LoadQuery, FatalError, Reader ExtraDependencies, Input RandomToken, Input MetaArguments, Reader DynamicMeta, Log] r | |
=> FilePath | Local SQL file |
-> SqlTemplateVariables | Any additional variables you want to bind |
-> SExp | Timestamp column in the destination table |
-> Day | Start time when creating table fresh |
-> Integer | N days to go bac |
-> Sem r () |
incrementalByTimeCreateAction :: forall effs. Members [SqlWrite, SqlRead, Time, Reader TargetName, Input MetaArguments, Reader HiddenDependencies, Input RandomToken, RecreateTable, Reader DynamicMeta, FatalError, Log] effs => (Day -> Sem effs Query) -> Day -> (Day -> SExp) -> Integer -> Sem effs () #
incrementalInsert :: forall effs. Members [SqlWrite, SqlRead, Input RandomToken, Reader TargetName, Reader HiddenDependencies, Reader DynamicMeta] effs => (Day -> Sem effs Query) -> (Day -> SExp) -> Integer -> Day -> Sem effs () #
loadSqlFileWithCutoff :: forall effs. Members [SqlParse, SqlRender, FatalError, LoadQuery] effs => FilePath -> SqlTemplateVariables -> Day -> Sem effs Query #
:: forall effs. Members [SqlWrite, SqlRead, Input RandomToken, Reader HiddenDependencies, Reader TargetName, RecreateTable] effs | |
=> Ref Table | the long table from which this table will be derived- make sure it is also listed in the dependencies |
-> (SExp -> SExp) | Aggregate function to use |
-> [Alias SExp] | the key columns which will remain in the resultant wide version as-is |
-> SExp | the column name in the long table which will be split into multiple columns in the wide version |
-> SExp | the column in the long table which will be emitted from matching on the new columns |
-> (Value -> Ref SExp) | a function to generate column names from the values found in the database |
-> SpecTarget | standard table options |
-> Sem effs () |
:: forall effs. Members '[SqlWrite, SqlRead, Reader ExtraDependencies, Reader TargetName, RecreateTable] effs | |
=> SpecTarget | |
-> (Query -> Query) | Any final optional query modification |
-> [Relation] | List of sources to combine |
-> Sem effs () |
externalCreate :: Members [FatalError, SqlRead, ExternalCreate, Reader TargetName, Reader ExtraDependencies, Input MetaArguments] r => Set (Ref Table) -> Text -> [Text] -> Sem r () #
createRawSql :: forall r. Members [FatalError, Reader TargetName, Reader ExtraDependencies, Reader HiddenDependencies, Reader QueryTransformer, RecreateTable, LoadQuery, SqlParse, SqlWrite] r => FilePath -> SqlTemplateVariables -> ExtraDependencies -> HiddenDependencies -> SpecTarget -> Sem r () #
recreateTarget :: Members [RecreateTable, Reader TargetName, SqlWrite] effs => SpecTarget -> NonEmpty Query -> Sem effs () #
createWithQuery :: forall r. Members [FatalError, Reader TargetName, Reader ExtraDependencies, Reader HiddenDependencies, Reader QueryTransformer, RecreateTable, LoadQuery, SqlParse, SqlWrite] r => NonEmpty Query -> SpecTarget -> ExtraDependencies -> HiddenDependencies -> Sem r () #