MCPcopy Index your code
hub / github.com/bytebase/bytebase / defineTable

Function defineTable

backend/plugin/parser/tidb/completion.go:256–264  ·  view source on GitHub ↗

defineTable installs a table in the catalog, retrying with generic column types if the real types fail to parse so that column names still surface.

(cat *catalog.Catalog, name string, columns []*storepb.ColumnMetadata)

Source from the content-addressed store, hash-verified

254// defineTable installs a table in the catalog, retrying with generic column
255// types if the real types fail to parse so that column names still surface.
256func defineTable(cat *catalog.Catalog, name string, columns []*storepb.ColumnMetadata) {
257 if len(columns) == 0 {
258 return
259 }
260 if execTableDDL(cat, name, columns, false) {
261 return
262 }
263 execTableDDL(cat, name, columns, true)
264}
265
266func execTableDDL(cat *catalog.Catalog, name string, columns []*storepb.ColumnMetadata, generic bool) bool {
267 defs := make([]string, 0, len(columns))

Callers 1

loadDatabaseObjectsFunction · 0.85

Calls 1

execTableDDLFunction · 0.85

Tested by

no test coverage detected