MCPcopy
hub / github.com/crowdsecurity/crowdsec / checkColumn

Function checkColumn

pkg/database/ent/ent.go:83–100  ·  view source on GitHub ↗

checkColumn checks if the column exists in the given table.

(t, c string)

Source from the content-addressed store, hash-verified

81
82// checkColumn checks if the column exists in the given table.
83func 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.
103func Asc(fields ...string) func(*sql.Selector) {

Callers 6

AscFunction · 0.85
DescFunction · 0.85
MaxFunction · 0.85
MeanFunction · 0.85
MinFunction · 0.85
SumFunction · 0.85

Calls 1

DoMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…