MCPcopy Index your code
hub / github.com/sqlc-dev/sqlc / convertTableSource

Method convertTableSource

internal/engine/dolphin/convert.go:1509–1535  ·  view source on GitHub ↗
(node *pcast.TableSource)

Source from the content-addressed store, hash-verified

1507}
1508
1509func (c *cc) convertTableSource(node *pcast.TableSource) ast.Node {
1510 if node == nil {
1511 return nil
1512 }
1513 alias := node.AsName.String()
1514 switch n := node.Source.(type) {
1515
1516 case *pcast.SelectStmt, *pcast.SetOprStmt:
1517 rs := &ast.RangeSubselect{
1518 Subquery: c.convert(n),
1519 }
1520 if alias != "" {
1521 rs.Alias = &ast.Alias{Aliasname: &alias}
1522 }
1523 return rs
1524
1525 case *pcast.TableName:
1526 rv := c.convertTableName(n)
1527 if alias != "" {
1528 rv.Alias = &ast.Alias{Aliasname: &alias}
1529 }
1530 return rv
1531
1532 default:
1533 return todo(n)
1534 }
1535}
1536
1537func (c *cc) convertTableToTable(n *pcast.TableToTable) ast.Node {
1538 return todo(n)

Callers 1

convertMethod · 0.95

Calls 4

convertMethod · 0.95
convertTableNameMethod · 0.95
todoFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected