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

Method SQL

pkg/sql/ast/sql.go:890–908  ·  view source on GitHub ↗

SQL returns the SQL representation of this DROP statement, including the object type, optional IF EXISTS, object names, and CASCADE/RESTRICT behavior.

()

Source from the content-addressed store, hash-verified

888// SQL returns the SQL representation of this DROP statement, including the
889// object type, optional IF EXISTS, object names, and CASCADE/RESTRICT behavior.
890func (d *DropStatement) SQL() string {
891 if d == nil {
892 return ""
893 }
894 sb := getBuilder()
895 defer putBuilder(sb)
896 sb.WriteString("DROP ")
897 sb.WriteString(d.ObjectType)
898 sb.WriteString(" ")
899 if d.IfExists {
900 sb.WriteString("IF EXISTS ")
901 }
902 sb.WriteString(strings.Join(d.Names, ", "))
903 if d.CascadeType != "" {
904 sb.WriteString(" ")
905 sb.WriteString(d.CascadeType)
906 }
907 return sb.String()
908}
909
910// SQL returns the SQL representation of this TRUNCATE statement, including
911// table names, RESTART/CONTINUE IDENTITY options, and CASCADE/RESTRICT behavior.

Callers 3

TestDropStatement_SQLFunction · 0.95
TestNilSQLFunction · 0.95
TestDropStatementSQLFunction · 0.95

Calls 3

getBuilderFunction · 0.85
putBuilderFunction · 0.85
StringMethod · 0.45

Tested by 3

TestDropStatement_SQLFunction · 0.76
TestNilSQLFunction · 0.76
TestDropStatementSQLFunction · 0.76