MCPcopy
hub / github.com/sqldef/sqldef / ColumnName

Method ColumnName

schema/ast.go:291–298  ·  view source on GitHub ↗

ColumnName returns the column name if this is a simple column reference. For functional indexes or expressions, it returns the string representation. FIXME: parser.String(ic.columnExpr) is not actually a correct column name.

()

Source from the content-addressed store, hash-verified

289// For functional indexes or expressions, it returns the string representation.
290// FIXME: parser.String(ic.columnExpr) is not actually a correct column name.
291func (ic IndexColumn) ColumnName() string {
292 // Check if it's a simple column reference (ColName)
293 if colName, ok := ic.columnExpr.(*parser.ColName); ok {
294 return colName.Name.Name
295 }
296 // For expressions, return the full expression string
297 return parser.String(ic.columnExpr)
298}
299
300// IndexColumn.direction
301const (

Callers 7

generateAddIndexMethod · 0.80
isPrimaryKeyMethod · 0.80
aggregateDDLsToSchemaFunction · 0.80
parseTableFunction · 0.80
parseIndexFunction · 0.80

Calls 1

StringFunction · 0.92

Tested by

no test coverage detected