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

Function joinSQL

pkg/formatter/render.go:1331–1345  ·  view source on GitHub ↗

joinSQL renders a JOIN clause.

(j *ast.JoinClause, f *nodeFormatter)

Source from the content-addressed store, hash-verified

1329
1330// joinSQL renders a JOIN clause.
1331func joinSQL(j *ast.JoinClause, f *nodeFormatter) string {
1332 var sb strings.Builder
1333 sb.WriteString(f.kw(j.Type))
1334 sb.WriteString(" ")
1335 sb.WriteString(f.kw("JOIN"))
1336 sb.WriteString(" ")
1337 sb.WriteString(tableRefSQL(&j.Right, f))
1338 if j.Condition != nil {
1339 sb.WriteString(" ")
1340 sb.WriteString(f.kw("ON"))
1341 sb.WriteString(" ")
1342 sb.WriteString(exprSQL(j.Condition))
1343 }
1344 return sb.String()
1345}
1346
1347// windowSpecSQL renders a window specification.
1348func windowSpecSQL(w *ast.WindowSpec) string {

Callers 1

renderSelectFunction · 0.70

Calls 4

kwMethod · 0.80
tableRefSQLFunction · 0.70
exprSQLFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected