MCPcopy Create free account
hub / github.com/bytebase/bytebase / writeSuffixSelectClause

Function writeSuffixSelectClause

backend/plugin/parser/mysql/backup.go:336–344  ·  view source on GitHub ↗

writeSuffixSelectClause writes the FROM ... WHERE ... suffix of a DML statement.

(buf *strings.Builder, node ast.Node, fullSQL string)

Source from the content-addressed store, hash-verified

334
335// writeSuffixSelectClause writes the FROM ... WHERE ... suffix of a DML statement.
336func writeSuffixSelectClause(buf *strings.Builder, node ast.Node, fullSQL string) error {
337 switch n := node.(type) {
338 case *ast.UpdateStmt:
339 return writeUpdateSuffix(buf, n, fullSQL)
340 case *ast.DeleteStmt:
341 return writeDeleteSuffix(buf, n, fullSQL)
342 }
343 return nil
344}
345
346func writeUpdateSuffix(buf *strings.Builder, n *ast.UpdateStmt, sql string) error {
347 // For UPDATE: write "table_refs WHERE ... ORDER BY ... LIMIT ..."

Callers 1

generateSQLForTableFunction · 0.70

Calls 2

writeUpdateSuffixFunction · 0.70
writeDeleteSuffixFunction · 0.70

Tested by

no test coverage detected