Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- splitIfUnionBy :: forall b r a. Members [SqlWrite b, RecreateTable b] r => Int -> Sem r a -> Sem r a
- incrementalInsertByPK :: forall b r. Members [SqlWrite b, SqlRead b, Time, Reader TargetName, Reader HiddenDependencies, RecreateTable b] r => (Day -> Sem r Query) -> SExp -> Day -> Integer -> BackendTableMeta b -> Sem r ()
- incrementalByTimeRawSql :: forall b r. (Members [SqlWrite b, SqlRead b, Time, Reader TargetName, Reader HiddenDependencies, Reader HiddenArtifacts, RecreateTable b, SqlParse, SqlRender, LoadQuery, FatalError, Output ExtraDependencies, Input RandomToken, Input MetaArguments, Log] r, Default (BackendTableMeta b)) => FilePath -> SqlTemplateVariables -> SExp -> Day -> Integer -> BackendTableMeta b -> Sem r ()
- incrementalByTimeCreateAction :: forall b r. (Members [SqlWrite b, SqlRead b, Time, Reader TargetName, Input MetaArguments, Reader HiddenDependencies, Reader HiddenArtifacts, Input RandomToken, RecreateTable b, FatalError, Log] r, Default (BackendTableMeta b)) => (Day -> Sem r Query) -> Day -> (Day -> SExp) -> Integer -> BackendTableMeta b -> Sem r ()
- loadSqlFileWithCutoff :: forall r. Members [SqlParse, SqlRender, FatalError, LoadQuery] r => FilePath -> SqlTemplateVariables -> Day -> Sem r Query
- copyData :: forall b r. Member (SqlWrite b) r => Ref Table -> Ref Table -> Sem r ()
- longToWideAuto :: forall b r. Members [SqlWrite b, SqlRead b, Input RandomToken, Reader HiddenDependencies, Reader TargetName, RecreateTable b] r => Ref Table -> (SExp -> SExp) -> [Alias SExp] -> SExp -> SExp -> (Value -> Ref SExp) -> SpecTarget b -> Sem r ()
- combineTables :: forall b r. (Members '[SqlWrite b, SqlRead b, Output ExtraDependencies, Reader TargetName, RecreateTable b] r, HasBackendSchemaField b) => SpecTarget b -> (Query -> Query) -> [Relation] -> Sem r ()
- externalCreate :: Members [FatalError, SqlRead b, ExternalCreate, Reader TargetName, Output ExtraDependencies, Input MetaArguments] r => Set (Ref Table) -> Text -> [Text] -> Sem r ()
- createRawSql :: forall b r. Members [FatalError, Reader TargetName, Output ExtraDependencies, Reader HiddenDependencies, Reader QueryTransformer, RecreateTable b, LoadQuery, SqlParse, SqlWrite b] r => FilePath -> SqlTemplateVariables -> ExtraDependencies -> HiddenDependencies -> SpecTarget b -> Sem r ()
- createWithQuery :: forall b r. Members [FatalError, Reader TargetName, Output ExtraDependencies, Reader HiddenDependencies, Reader QueryTransformer, RecreateTable b, LoadQuery, SqlParse, SqlWrite b] r => NonEmpty Query -> SpecTarget b -> ExtraDependencies -> HiddenDependencies -> Sem r ()
- recreateTarget :: forall b r. Members [RecreateTable b, Reader TargetName, SqlWrite b] r => SpecTarget b -> NonEmpty Query -> Sem r ()
Documentation
splitIfUnionBy :: forall b r a. Members [SqlWrite b, RecreateTable b] r => Int -> Sem r a -> Sem r a #
Intercept CreateTableAs calls and try to split queries into CreateTableAs + multiple InsertIntoQuery when query contains unions
:: forall b r. Members [SqlWrite b, SqlRead b, Time, Reader TargetName, Reader HiddenDependencies, RecreateTable b] r | |
=> (Day -> Sem r Query) | Query with cutoff |
-> SExp | Primary key column |
-> Day | Starting timestamp value in fresh create |
-> Integer | Num days to look back in each update |
-> BackendTableMeta b | |
-> Sem r () |
:: forall b r. (Members [SqlWrite b, SqlRead b, Time, Reader TargetName, Reader HiddenDependencies, Reader HiddenArtifacts, RecreateTable b, SqlParse, SqlRender, LoadQuery, FatalError, Output ExtraDependencies, Input RandomToken, Input MetaArguments, Log] r, Default (BackendTableMeta b)) | |
=> 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 |
-> BackendTableMeta b | |
-> Sem r () |
incrementalByTimeCreateAction :: forall b r. (Members [SqlWrite b, SqlRead b, Time, Reader TargetName, Input MetaArguments, Reader HiddenDependencies, Reader HiddenArtifacts, Input RandomToken, RecreateTable b, FatalError, Log] r, Default (BackendTableMeta b)) => (Day -> Sem r Query) -> Day -> (Day -> SExp) -> Integer -> BackendTableMeta b -> Sem r () #
loadSqlFileWithCutoff :: forall r. Members [SqlParse, SqlRender, FatalError, LoadQuery] r => FilePath -> SqlTemplateVariables -> Day -> Sem r Query #
:: forall b r. Members [SqlWrite b, SqlRead b, Input RandomToken, Reader HiddenDependencies, Reader TargetName, RecreateTable b] r | |
=> 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 b | standard table options |
-> Sem r () |
:: forall b r. (Members '[SqlWrite b, SqlRead b, Output ExtraDependencies, Reader TargetName, RecreateTable b] r, HasBackendSchemaField b) | |
=> SpecTarget b | |
-> (Query -> Query) | Any final optional query modification |
-> [Relation] | List of sources to combine |
-> Sem r () |
externalCreate :: Members [FatalError, SqlRead b, ExternalCreate, Reader TargetName, Output ExtraDependencies, Input MetaArguments] r => Set (Ref Table) -> Text -> [Text] -> Sem r () #
createRawSql :: forall b r. Members [FatalError, Reader TargetName, Output ExtraDependencies, Reader HiddenDependencies, Reader QueryTransformer, RecreateTable b, LoadQuery, SqlParse, SqlWrite b] r => FilePath -> SqlTemplateVariables -> ExtraDependencies -> HiddenDependencies -> SpecTarget b -> Sem r () #
createWithQuery :: forall b r. Members [FatalError, Reader TargetName, Output ExtraDependencies, Reader HiddenDependencies, Reader QueryTransformer, RecreateTable b, LoadQuery, SqlParse, SqlWrite b] r => NonEmpty Query -> SpecTarget b -> ExtraDependencies -> HiddenDependencies -> Sem r () #
recreateTarget :: forall b r. Members [RecreateTable b, Reader TargetName, SqlWrite b] r => SpecTarget b -> NonEmpty Query -> Sem r () #