MCPcopy
hub / github.com/sqlc-dev/sqlc / makeColumnTargetWithPrefix

Function makeColumnTargetWithPrefix

internal/x/expander/expander.go:491–507  ·  view source on GitHub ↗

makeColumnTargetWithPrefix creates a ResTarget node for a column reference with optional table prefix

(colName string, prefix []string)

Source from the content-addressed store, hash-verified

489
490// makeColumnTargetWithPrefix creates a ResTarget node for a column reference with optional table prefix
491func makeColumnTargetWithPrefix(colName string, prefix []string) ast.Node {
492 fields := make([]ast.Node, 0, len(prefix)+1)
493
494 // Add prefix parts (schema, table name)
495 for _, p := range prefix {
496 fields = append(fields, &ast.String{Str: p})
497 }
498
499 // Add column name
500 fields = append(fields, &ast.String{Str: colName})
501
502 return &ast.ResTarget{
503 Val: &ast.ColumnRef{
504 Fields: &ast.List{Items: fields},
505 },
506 }
507}

Callers 1

rewriteTargetListFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected