Add config driven presets for insert, update and upsert
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user