MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / columnDefSQL

Function columnDefSQL

pkg/formatter/render.go:1452–1463  ·  view source on GitHub ↗

columnDefSQL renders a column definition.

(c *ast.ColumnDef)

Source from the content-addressed store, hash-verified

1450
1451// columnDefSQL renders a column definition.
1452func columnDefSQL(c *ast.ColumnDef) string {
1453 var sb strings.Builder
1454 sb.WriteString(c.Name)
1455 sb.WriteString(" ")
1456 sb.WriteString(c.Type)
1457 for _, con := range c.Constraints {
1458 con := con
1459 sb.WriteString(" ")
1460 sb.WriteString(columnConstraintSQL(&con))
1461 }
1462 return sb.String()
1463}
1464
1465// columnConstraintSQL renders a column constraint.
1466func columnConstraintSQL(c *ast.ColumnConstraint) string {

Callers 2

renderCreateTableFunction · 0.70
renderAlterTableFunction · 0.70

Calls 2

columnConstraintSQLFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected