MCPcopy
hub / github.com/sqlc-dev/sqlc / getTable

Method getTable

internal/sql/catalog/schema.go:64–71  ·  view source on GitHub ↗
(rel *ast.TableName)

Source from the content-addressed store, hash-verified

62}
63
64func (s *Schema) getTable(rel *ast.TableName) (*Table, int, error) {
65 for i := range s.Tables {
66 if s.Tables[i].Rel.Name == rel.Name {
67 return s.Tables[i], i, nil
68 }
69 }
70 return nil, -1, sqlerr.RelationNotFound(rel.Name)
71}
72
73func (s *Schema) getType(rel *ast.TypeName) (Type, int, error) {
74 for i := range s.Types {

Callers 6

getTableMethod · 0.95
createEnumMethod · 0.45
createCompositeTypeMethod · 0.45
alterTypeSetSchemaMethod · 0.45
renameTypeMethod · 0.45
createViewMethod · 0.45

Calls 1

RelationNotFoundFunction · 0.92

Tested by

no test coverage detected