(cat *catalog.Catalog, name string, columns []*storepb.ColumnMetadata, generic bool)
| 264 | } |
| 265 | |
| 266 | func execTableDDL(cat *catalog.Catalog, name string, columns []*storepb.ColumnMetadata, generic bool) bool { |
| 267 | defs := make([]string, 0, len(columns)) |
| 268 | for _, col := range columns { |
| 269 | colType := col.GetType() |
| 270 | if generic || colType == "" { |
| 271 | colType = genericColumnType |
| 272 | } |
| 273 | defs = append(defs, backtickIdentifier(col.GetName())+" "+colType) |
| 274 | } |
| 275 | ddl := fmt.Sprintf("CREATE TABLE %s (%s);", backtickIdentifier(name), strings.Join(defs, ", ")) |
| 276 | return execOK(cat, ddl) |
| 277 | } |
| 278 | |
| 279 | // defineView installs a view in the catalog. Unlike tables, the only structured |
| 280 | // input is the view's definition SQL, whose exact shape varies (full |
no test coverage detected