VisitTableName visits the node
(ctx *antlrgen.TableNameContext)
| 905 | |
| 906 | // VisitTableName visits the node |
| 907 | func (v *ASTBuilder) VisitTableName(ctx *antlrgen.TableNameContext) interface{} { |
| 908 | v.Logger.Debugf("VisitTableName: %s", ctx.GetText()) |
| 909 | |
| 910 | last := len(v.SQL2AqlCtx.MapJoinTables[v.SQL2AqlCtx.mapKey]) - 1 |
| 911 | // check if the table name is a withQ identifier |
| 912 | name := v.getText(ctx.BaseParserRuleContext) |
| 913 | qLevel, _, _ := v.getInfoByKey(v.SQL2AqlCtx.mapKey) |
| 914 | if qLevel == 0 && v.isWithQueryIdentifier(v.SQL2AqlCtx, name) { |
| 915 | v.SQL2AqlCtx.MapJoinTables[v.SQL2AqlCtx.mapKey][last].Alias = name |
| 916 | } else { |
| 917 | v.SQL2AqlCtx.MapJoinTables[v.SQL2AqlCtx.mapKey][last].Table = name |
| 918 | } |
| 919 | |
| 920 | table := tree.NewTable(v.getLocation(ctx), v.getQualifiedName(ctx.QualifiedName())) |
| 921 | table.SetValue(fmt.Sprintf("Table: (%s)", v.getText(ctx.BaseParserRuleContext))) |
| 922 | |
| 923 | return table |
| 924 | } |
| 925 | |
| 926 | // VisitSubqueryRelation visits the node |
| 927 | func (v *ASTBuilder) VisitSubqueryRelation(ctx *antlrgen.SubqueryRelationContext) interface{} { |
nothing calls this directly
no test coverage detected