MCPcopy Create free account
hub / github.com/AdRoll/baker / vetIdentifiers

Method vetIdentifiers

output/sqlite.go:217–234  ·  view source on GitHub ↗

vetIdentifiers checks all identifiers respect some rule so that we can use them safely in queries.

()

Source from the content-addressed store, hash-verified

215// vetIdentifiers checks all identifiers respect some rule so that we can use
216// them safely in queries.
217func (c *SQLite) vetIdentifiers() error {
218 ids := map[string]string{
219 "TableName": c.cfg.TableName,
220 "RecordBlobName": c.cfg.RecordBlobName,
221 }
222
223 for _, f := range c.fieldNames {
224 ids["field "+f] = f
225 }
226
227 for name, id := range ids {
228 if !isPrintable(id) {
229 return fmt.Errorf("%s contains non-printable characters", name)
230 }
231 }
232
233 return nil
234}
235
236func (c *SQLite) Run(input <-chan baker.OutputRecord, upch chan<- string) error {
237 err := c.doRun(input)

Callers 1

setupMethod · 0.95

Calls 1

isPrintableFunction · 0.85

Tested by

no test coverage detected