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

Method Table

datasource/mockcsv/mockcsv.go:117–133  ·  view source on GitHub ↗

Table get table schema for given table name. If given table is not currently defined, will load, infer schema.

(tableName string)

Source from the content-addressed store, hash-verified

115// Table get table schema for given table name. If given table is not currently
116// defined, will load, infer schema.
117func (m *Source) Table(tableName string) (*schema.Table, error) {
118
119 tableName = strings.ToLower(tableName)
120 if ds, ok := m.tables[tableName]; ok {
121 return ds.Table(tableName)
122 }
123 err := m.loadTable(tableName)
124 if err != nil {
125 u.Errorf("could not load table %q err=%v", tableName, err)
126 return nil, err
127 }
128 ds, ok := m.tables[tableName]
129 if !ok {
130 return nil, schema.ErrNotFound
131 }
132 return ds.Table(tableName)
133}
134
135func (m *Source) loadTable(tableName string) error {
136

Callers

nothing calls this directly

Calls 3

loadTableMethod · 0.95
ErrorfMethod · 0.80
TableMethod · 0.65

Tested by

no test coverage detected