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

Method commentOnColumn

internal/sql/catalog/comment_on.go:8–24  ·  view source on GitHub ↗
(stmt *ast.CommentOnColumnStmt)

Source from the content-addressed store, hash-verified

6)
7
8func (c *Catalog) commentOnColumn(stmt *ast.CommentOnColumnStmt) error {
9 _, t, err := c.getTable(stmt.Table)
10 if err != nil {
11 return err
12 }
13 for i := range t.Columns {
14 if t.Columns[i].Name == stmt.Col.Name {
15 if stmt.Comment != nil {
16 t.Columns[i].Comment = *stmt.Comment
17 } else {
18 t.Columns[i].Comment = ""
19 }
20 return nil
21 }
22 }
23 return sqlerr.ColumnNotFound(stmt.Table.Name, stmt.Col.Name)
24}
25
26func (c *Catalog) commentOnSchema(stmt *ast.CommentOnSchemaStmt) error {
27 s, err := c.getSchema(stmt.Schema.Str)

Callers 1

UpdateMethod · 0.95

Calls 2

getTableMethod · 0.95
ColumnNotFoundFunction · 0.92

Tested by

no test coverage detected