MCPcopy Index your code
hub / github.com/sqlc-dev/sqlc / getTable

Method getTable

internal/sql/catalog/table.go:142–162  ·  view source on GitHub ↗
(tableName *ast.TableName)

Source from the content-addressed store, hash-verified

140}
141
142func (c *Catalog) getTable(tableName *ast.TableName) (*Schema, *Table, error) {
143 schemaName := tableName.Schema
144 if schemaName == "" {
145 schemaName = c.DefaultSchema
146 }
147 var schema *Schema
148 for i := range c.Schemas {
149 if c.Schemas[i].Name == schemaName {
150 schema = c.Schemas[i]
151 break
152 }
153 }
154 if schema == nil {
155 return nil, nil, sqlerr.SchemaNotFound(schemaName)
156 }
157 table, _, err := schema.getTable(tableName)
158 if err != nil {
159 return nil, nil, err
160 }
161 return schema, table, nil
162}
163
164func isStmtImplemented(stmt *ast.AlterTableStmt) bool {
165 var implemented bool

Callers 11

alterTableMethod · 0.95
createTableMethod · 0.95
renameColumnMethod · 0.95
renameTableMethod · 0.95
GetTableMethod · 0.95
commentOnColumnMethod · 0.95
commentOnTableMethod · 0.95
commentOnViewMethod · 0.95
alterTableSetSchemaMethod · 0.45
dropTableMethod · 0.45
createTableAsMethod · 0.45

Calls 2

getTableMethod · 0.95
SchemaNotFoundFunction · 0.92

Tested by

no test coverage detected