MCPcopy Index your code
hub / github.com/netdata/netdata / tableColumnsQuery

Function tableColumnsQuery

src/go/plugin/go.d/pkg/sqlquery/columns.go:17–34  ·  view source on GitHub ↗
(style PlaceholderStyle)

Source from the content-addressed store, hash-verified

15)
16
17func tableColumnsQuery(style PlaceholderStyle) (string, error) {
18 switch style {
19 case PlaceholderQuestion:
20 return `
21SELECT COLUMN_NAME
22FROM information_schema.COLUMNS
23WHERE TABLE_SCHEMA = ?
24 AND TABLE_NAME = ?`, nil
25 case PlaceholderDollar:
26 return `
27SELECT COLUMN_NAME
28FROM information_schema.COLUMNS
29WHERE TABLE_SCHEMA = $1
30 AND TABLE_NAME = $2`, nil
31 default:
32 return "", fmt.Errorf("unsupported placeholder style: %d", style)
33 }
34}
35
36// FetchTableColumns returns the set of column names for schema.table.
37// If transform is non-nil, it is applied to each column name before insertion.

Callers 2

TestFetchTableColumnsFunction · 0.85
FetchTableColumnsFunction · 0.85

Calls 1

ErrorfMethod · 0.65

Tested by 1

TestFetchTableColumnsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…