示例#1
0
        public QsiChangeSearchPathActionNode VisitUseStatement(UseStatement useStatement)
        {
            var node = new QsiChangeSearchPathActionNode
            {
                Identifiers = new[]
                {
                    IdentifierVisitor.CreateIdentifier(useStatement.DatabaseName),
                }
            };

            SqlServerTree.PutFragmentSpan(node, useStatement);

            return(node);
        }
示例#2
0
        public static QsiChangeSearchPathActionNode VisitUseStatement(UseStatementContext context)
        {
            var node = new QsiChangeSearchPathActionNode
            {
                Identifiers = new []
                {
                    context.ks.id,
                }
            };

            CqlTree.PutContextSpan(node, context);

            return(node);
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }