checkColumn checks if the column exists in the given table.
(t, c string)
| 81 | |
| 82 | // checkColumn checks if the column exists in the given table. |
| 83 | func checkColumn(t, c string) error { |
| 84 | initCheck.Do(func() { |
| 85 | columnCheck = sql.NewColumnCheck(map[string]func(string) bool{ |
| 86 | alert.Table: alert.ValidColumn, |
| 87 | allowlist.Table: allowlist.ValidColumn, |
| 88 | allowlistitem.Table: allowlistitem.ValidColumn, |
| 89 | bouncer.Table: bouncer.ValidColumn, |
| 90 | configitem.Table: configitem.ValidColumn, |
| 91 | decision.Table: decision.ValidColumn, |
| 92 | event.Table: event.ValidColumn, |
| 93 | lock.Table: lock.ValidColumn, |
| 94 | machine.Table: machine.ValidColumn, |
| 95 | meta.Table: meta.ValidColumn, |
| 96 | metric.Table: metric.ValidColumn, |
| 97 | }) |
| 98 | }) |
| 99 | return columnCheck(t, c) |
| 100 | } |
| 101 | |
| 102 | // Asc applies the given fields in ASC order. |
| 103 | func Asc(fields ...string) func(*sql.Selector) { |