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

Function isStmtImplemented

internal/sql/catalog/table.go:164–184  ·  view source on GitHub ↗
(stmt *ast.AlterTableStmt)

Source from the content-addressed store, hash-verified

162}
163
164func isStmtImplemented(stmt *ast.AlterTableStmt) bool {
165 var implemented bool
166 for _, item := range stmt.Cmds.Items {
167 switch cmd := item.(type) {
168 case *ast.AlterTableCmd:
169 switch cmd.Subtype {
170 case ast.AT_AddColumn:
171 implemented = true
172 case ast.AT_AlterColumnType:
173 implemented = true
174 case ast.AT_DropColumn:
175 implemented = true
176 case ast.AT_DropNotNull:
177 implemented = true
178 case ast.AT_SetNotNull:
179 implemented = true
180 }
181 }
182 }
183 return implemented
184}
185
186func (c *Catalog) alterTable(stmt *ast.AlterTableStmt) error {
187 if !isStmtImplemented(stmt) {

Callers 1

alterTableMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected