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

Method Open

datasource/mockcsv/mockcsv.go:100–113  ·  view source on GitHub ↗

Open connection to given tablename.

(tableName string)

Source from the content-addressed store, hash-verified

98
99// Open connection to given tablename.
100func (m *Source) Open(tableName string) (schema.Conn, error) {
101
102 tableName = strings.ToLower(tableName)
103 if ds, ok := m.tables[tableName]; ok {
104 return &Table{StaticDataSource: ds}, nil
105 }
106 err := m.loadTable(tableName)
107 if err != nil {
108 u.Errorf("could not load table %q err=%v", tableName, err)
109 return nil, err
110 }
111 ds := m.tables[tableName]
112 return &Table{StaticDataSource: ds}, nil
113}
114
115// Table get table schema for given table name. If given table is not currently
116// defined, will load, infer schema.

Callers

nothing calls this directly

Calls 2

loadTableMethod · 0.95
ErrorfMethod · 0.80

Tested by

no test coverage detected