Skip to content

Commit

Permalink
improve naming
Browse files Browse the repository at this point in the history
  • Loading branch information
mscoutermarsh committed May 1, 2023
1 parent 1522455 commit ba4423c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions internal/dumper/dumper.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,19 +230,19 @@ func (d *Dumper) dumpTable(conn *Connection, database string, table string) erro
return err
}

for _, fld := range flds {
d.log.Debug("dump", zap.Any("filters", d.cfg.Filters), zap.String("table", table), zap.String("field_name", fld))
for _, name := range flds {
d.log.Debug("dump", zap.Any("filters", d.cfg.Filters), zap.String("table", table), zap.String("field_name", name))

if _, ok := d.cfg.Filters[table][fld]; ok {
if _, ok := d.cfg.Filters[table][name]; ok {
continue
}

fields = append(fields, fmt.Sprintf("`%s`", fld))
replacement, ok := d.cfg.Selects[table][fld]
fields = append(fields, fmt.Sprintf("`%s`", name))
replacement, ok := d.cfg.Selects[table][name]
if ok {
selfields = append(selfields, fmt.Sprintf("%s AS `%s`", replacement, fld))
selfields = append(selfields, fmt.Sprintf("%s AS `%s`", replacement, name))
} else {
selfields = append(selfields, fmt.Sprintf("`%s`", fld))
selfields = append(selfields, fmt.Sprintf("`%s`", name))
}
}
}
Expand Down

0 comments on commit ba4423c

Please sign in to comment.