Preserve allow.list ordering on save

This commit is contained in:
Vikram Rangnekar
2019-10-25 01:39:59 -04:00
parent 4edc15eb98
commit cabd2d81ae
18 changed files with 341 additions and 223 deletions

View File

@ -7,25 +7,25 @@ type Config struct {
type QueryConfig struct {
Limit int
Filter []string
Filters []string
Columns []string
DisableFunctions bool
}
type InsertConfig struct {
Filter []string
Filters []string
Columns []string
Set map[string]string
}
type UpdateConfig struct {
Filter []string
Filters []string
Columns []string
Set map[string]string
}
type DeleteConfig struct {
Filter []string
Filters []string
Columns []string
}

View File

@ -190,7 +190,7 @@ func (com *Compiler) AddRole(role, table string, trc TRConfig) error {
}
// query config
trv.query.fil, err = compileFilter(trc.Query.Filter)
trv.query.fil, err = compileFilter(trc.Query.Filters)
if err != nil {
return err
}
@ -201,20 +201,20 @@ func (com *Compiler) AddRole(role, table string, trc TRConfig) error {
trv.query.disable.funcs = trc.Query.DisableFunctions
// insert config
if trv.insert.fil, err = compileFilter(trc.Insert.Filter); err != nil {
if trv.insert.fil, err = compileFilter(trc.Insert.Filters); err != nil {
return err
}
trv.insert.cols = toMap(trc.Insert.Columns)
// update config
if trv.update.fil, err = compileFilter(trc.Update.Filter); err != nil {
if trv.update.fil, err = compileFilter(trc.Update.Filters); err != nil {
return err
}
trv.insert.cols = toMap(trc.Insert.Columns)
trv.insert.set = trc.Insert.Set
// delete config
if trv.delete.fil, err = compileFilter(trc.Delete.Filter); err != nil {
if trv.delete.fil, err = compileFilter(trc.Delete.Filters); err != nil {
return err
}
trv.delete.cols = toMap(trc.Delete.Columns)