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

Method SQL

pkg/sql/ast/sql.go:872–886  ·  view source on GitHub ↗

SQL returns the SQL representation of this ALTER TABLE statement. Note: the parser returns AlterStatement (in alter.go); this method is for manually-constructed AlterTableStatement values.

()

Source from the content-addressed store, hash-verified

870// Note: the parser returns AlterStatement (in alter.go); this method
871// is for manually-constructed AlterTableStatement values.
872func (a *AlterTableStatement) SQL() string {
873 if a == nil {
874 return ""
875 }
876 sb := getBuilder()
877 defer putBuilder(sb)
878 sb.WriteString("ALTER TABLE ")
879 sb.WriteString(a.Table)
880 for _, action := range a.Actions {
881 action := action // G601: Create local copy to avoid memory aliasing
882 sb.WriteString(" ")
883 sb.WriteString(alterActionSQL(&action))
884 }
885 return sb.String()
886}
887
888// SQL returns the SQL representation of this DROP statement, including the
889// object type, optional IF EXISTS, object names, and CASCADE/RESTRICT behavior.

Callers 2

TestNilSQLFunction · 0.95

Calls 4

getBuilderFunction · 0.85
putBuilderFunction · 0.85
alterActionSQLFunction · 0.85
StringMethod · 0.45

Tested by 2

TestNilSQLFunction · 0.76