MCPcopy Index your code
hub / github.com/Masterminds/structable / publicTables

Function publicTables

schema2struct/schema2struct.go:166–182  ·  view source on GitHub ↗
(b squirrel.StatementBuilderType)

Source from the content-addressed store, hash-verified

164}
165
166func publicTables(b squirrel.StatementBuilderType) ([]string, error) {
167 rows, err := b.Select("table_name").From("INFORMATION_SCHEMA.TABLES").
168 Where("table_schema = 'public'").Query()
169
170 res := []string{}
171 if err != nil {
172 return res, err
173 }
174
175 for rows.Next() {
176 var s string
177 rows.Scan(&s)
178 res = append(res, s)
179 }
180
181 return res, nil
182}
183
184// importTable reads a table definition and writes a corresponding struct.
185// SELECT table_name, column_name, data_type, character_maximum_length

Callers 1

importTablesFunction · 0.85

Calls 2

QueryMethod · 0.80
ScanMethod · 0.80

Tested by

no test coverage detected