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

Method convertColumnNameExpr

internal/engine/sqlite/convert.go:318–339  ·  view source on GitHub ↗
(n *parser.Expr_qualified_column_nameContext)

Source from the content-addressed store, hash-verified

316}
317
318func (c *cc) convertColumnNameExpr(n *parser.Expr_qualified_column_nameContext) *ast.ColumnRef {
319 var items []ast.Node
320 if schema, ok := n.Schema_name().(*parser.Schema_nameContext); ok {
321 schemaText := schema.GetText()
322 if schemaText != "" {
323 items = append(items, NewIdentifier(schemaText))
324 }
325 }
326 if table, ok := n.Table_name().(*parser.Table_nameContext); ok {
327 tableName := table.GetText()
328 if tableName != "" {
329 items = append(items, NewIdentifier(tableName))
330 }
331 }
332 items = append(items, NewIdentifier(n.Column_name().GetText()))
333 return &ast.ColumnRef{
334 Fields: &ast.List{
335 Items: items,
336 },
337 Location: n.GetStart().GetStart(),
338 }
339}
340
341func (c *cc) convertComparison(n *parser.Expr_comparisonContext) ast.Node {
342 lexpr := c.convert(n.Expr(0))

Callers 1

convertMethod · 0.95

Calls 6

GetTextMethod · 0.80
GetStartMethod · 0.80
NewIdentifierFunction · 0.70
Schema_nameMethod · 0.65
Table_nameMethod · 0.65
Column_nameMethod · 0.65

Tested by

no test coverage detected