コード例 #1
0
 public SelectElementVisitor(bool resolveColumnType, BatchOutputColumnTypeResolver columnTypeResolver, StatementWithCtesAndXmlNamespaces statement) : base(false)
 {
     this.resolveColumnType  = resolveColumnType;
     this.columnTypeResolver = new StatementOutputColumnTypeResolverV2(columnTypeResolver, statement);
     this.outputSet          = new ProcedureOutputSet(statement);
     this.statement          = statement;
 }
コード例 #2
0
        public QsiTreeNode VisitStatementWithCtesAndXmlNamespaces(StatementWithCtesAndXmlNamespaces statementWithCtesAndXmlNamespaces)
        {
            switch (statementWithCtesAndXmlNamespaces)
            {
            case SelectStatement selectStatement:
                return(VisitSelectStatement(selectStatement));
            }

            throw TreeHelper.NotSupportedTree(statementWithCtesAndXmlNamespaces);
        }
コード例 #3
0
        public static EngineResult Evaluate(StatementWithCtesAndXmlNamespaces statement, Scope scope)
        {
            if (statement.WithCtesAndXmlNamespaces?.CommonTableExpressions != null)
            {
                scope = Evaluate(statement.WithCtesAndXmlNamespaces.CommonTableExpressions, scope);
            }

            return(statement switch
            {
                SelectStatement select => Evaluate(select, scope),
                InsertStatement insert => Evaluate(insert.InsertSpecification, scope),
                UpdateStatement update => Evaluate(update.UpdateSpecification, scope),
                DeleteStatement delete => Evaluate(delete.DeleteSpecification, scope),
                MergeStatement merge => Evaluate(merge.MergeSpecification, scope),
                _ => throw FeatureNotSupportedException.Subtype(statement)
            });
コード例 #4
0
        private bool DoesStatementHaveDateFunction(StatementWithCtesAndXmlNamespaces statement)
        {
            bool hasDateFunction = false;

            var allFunctions = new FunctionCallVisitor();

            statement.Accept(allFunctions);

            if (allFunctions.Statements.Any(p => FunctionNames.Contains(p.FunctionName.Value.ToLower())))
            {
                hasDateFunction = true;
            }
            else
            {
                hasDateFunction = CheckFunctionCallsForDateFunction(allFunctions.Statements);
            }

            return(hasDateFunction);
        }
コード例 #5
0
 public override void ExplicitVisit(StatementWithCtesAndXmlNamespaces fragment)
 {
     _fragments.Add(fragment);
 }
コード例 #6
0
 internal ProcedureOutputSet(StatementWithCtesAndXmlNamespaces initiator)
 {
     this.initiator = initiator;
 }
コード例 #7
0
 public sealed override void ExplicitVisit(StatementWithCtesAndXmlNamespaces node)
 {
     base.ExplicitVisit(node);
 }
コード例 #8
0
 public StatementOutputColumnTypeResolverV1(BatchOutputColumnTypeResolver batchResolver, StatementWithCtesAndXmlNamespaces statement)
 {
     SchemaMetadata     = batchResolver.SchemaMetadata;
     this.batchResolver = batchResolver;
     this.statement     = statement;
 }
コード例 #9
0
ファイル: AllNodesVisitor.cs プロジェクト: yaakoviyun/sqlskim
 public override void ExplicitVisit(StatementWithCtesAndXmlNamespaces node) { this.action(node); }