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

Method convertColumnNameExpr

internal/engine/dolphin/convert.go:302–317  ·  view source on GitHub ↗
(n *pcast.ColumnNameExpr)

Source from the content-addressed store, hash-verified

300}
301
302func (c *cc) convertColumnNameExpr(n *pcast.ColumnNameExpr) *ast.ColumnRef {
303 var items []ast.Node
304 if schema := n.Name.Schema.String(); schema != "" {
305 items = append(items, NewIdentifier(schema))
306 }
307 if table := n.Name.Table.String(); table != "" {
308 items = append(items, NewIdentifier(table))
309 }
310 items = append(items, NewIdentifier(n.Name.Name.String()))
311 return &ast.ColumnRef{
312 Fields: &ast.List{
313 Items: items,
314 },
315 Location: n.OriginTextPosition(),
316 }
317}
318
319func (c *cc) convertColumnNames(cols []*pcast.ColumnName) *ast.List {
320 list := &ast.List{Items: []ast.Node{}}

Callers 2

convertByItemMethod · 0.95
convertMethod · 0.95

Calls 2

NewIdentifierFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected