public QsiChangeSearchPathActionNode VisitUseStatement(UseStatement useStatement) { var node = new QsiChangeSearchPathActionNode { Identifiers = new[] { IdentifierVisitor.CreateIdentifier(useStatement.DatabaseName), } }; SqlServerTree.PutFragmentSpan(node, useStatement); return(node); }
public static QsiChangeSearchPathActionNode VisitUseStatement(UseStatementContext context) { var node = new QsiChangeSearchPathActionNode { Identifiers = new [] { context.ks.id, } }; CqlTree.PutContextSpan(node, context); return(node); }
public static QsiTreeNode VisitVariableSetStmt(VariableSetStmt variableSetStmt) { if (variableSetStmt.kind == VariableSetKind.VAR_SET_VALUE && variableSetStmt.name == "search_path") { var node = new QsiChangeSearchPathActionNode { Identifiers = variableSetStmt.args .Cast <A_Const>() .Select(x => new QsiIdentifier(x.val.str, false)) .ToArray() }; return(node); } throw TreeHelper.NotSupportedTree(variableSetStmt); }
public static QsiChangeSearchPathActionNode VisitUseSchemaStatement(UseSchemaStatement context) { var schemaName = context.SchemaName; if (string.IsNullOrEmpty(schemaName)) { schemaName = "DEFAULT"; } var identifier = new QsiIdentifier(schemaName, IdentifierUtility.IsEscaped(schemaName)); var node = new QsiChangeSearchPathActionNode { Identifiers = new[] { identifier } }; PTree.RawNode[node] = context; return(node); }