MCPcopy Create free account
hub / github.com/araddon/qlbridge / SetColumnsFromFields

Method SetColumnsFromFields

schema/schema.go:561–570  ·  view source on GitHub ↗

SetColumnsFromFields Explicityly set column names from fields.

()

Source from the content-addressed store, hash-verified

559
560// SetColumnsFromFields Explicityly set column names from fields.
561func (m *Table) SetColumnsFromFields() {
562 m.FieldPositions = make(map[string]int, len(m.Fields))
563 cols := make([]string, len(m.Fields))
564 for idx, f := range m.Fields {
565 col := strings.ToLower(f.Name)
566 m.FieldPositions[col] = idx
567 cols[idx] = col
568 }
569 m.cols = cols
570}
571
572// Columns list of all column names.
573func (m *Table) Columns() []string { return m.cols }

Callers 2

tableFromSQLFunction · 0.95
TestTableFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestTableFunction · 0.76