Add config driven presets for insert, update and upsert

This commit is contained in:
Vikram Rangnekar
2019-10-30 03:27:11 -04:00
parent 8ae7210e70
commit b87ba1fcd0
7 changed files with 65 additions and 38 deletions

View File

@ -117,14 +117,14 @@ type configRole struct {
Insert struct {
Filters []string
Columns []string
Set map[string]string
Presets map[string]string
Block bool
}
Update struct {
Filters []string
Columns []string
Set map[string]string
Presets map[string]string
Block bool
}

View File

@ -48,7 +48,7 @@ func initCompilers(c *config) (*qcode.Compiler, *psql.Compiler, error) {
insert := qcode.InsertConfig{
Filters: t.Insert.Filters,
Columns: t.Insert.Columns,
Set: t.Insert.Set,
Presets: t.Insert.Presets,
}
if t.Query.Block {
@ -58,7 +58,7 @@ func initCompilers(c *config) (*qcode.Compiler, *psql.Compiler, error) {
update := qcode.UpdateConfig{
Filters: t.Insert.Filters,
Columns: t.Insert.Columns,
Set: t.Insert.Set,
Presets: t.Insert.Presets,
}
if t.Query.Block {