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

Method SQL

pkg/sql/ast/sql.go:56–64  ·  view source on GitHub ↗

SQL returns the SQL string representation of the AST.

()

Source from the content-addressed store, hash-verified

54
55// SQL returns the SQL string representation of the AST.
56func (a AST) SQL() string {
57 parts := make([]string, 0, len(a.Statements))
58 for _, stmt := range a.Statements {
59 if s, ok := stmt.(interface{ SQL() string }); ok {
60 parts = append(parts, s.SQL())
61 }
62 }
63 return strings.Join(parts, ";\n")
64}
65
66// ============================================================
67// Expressions

Callers 15

FormatMethod · 0.95
TestAST_SQL_MethodFunction · 0.95
TestRoundtripAST_SQLFunction · 0.95
TestInsertSelectFunction · 0.45
SQLMethod · 0.45
SQLMethod · 0.45
SQLMethod · 0.45
SQLMethod · 0.45
exprSQLFunction · 0.45
stmtSQLFunction · 0.45
tableRefSQLFunction · 0.45

Calls

no outgoing calls

Tested by 8

TestAST_SQL_MethodFunction · 0.76
TestRoundtripAST_SQLFunction · 0.76
TestInsertSelectFunction · 0.36
TestSQL_IdempotencyFunction · 0.36
TestSelectStatementSQLFunction · 0.36
TestInsertStatementSQLFunction · 0.36
TestRoundtripFunction · 0.36