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; }
public QsiTreeNode VisitStatementWithCtesAndXmlNamespaces(StatementWithCtesAndXmlNamespaces statementWithCtesAndXmlNamespaces) { switch (statementWithCtesAndXmlNamespaces) { case SelectStatement selectStatement: return(VisitSelectStatement(selectStatement)); } throw TreeHelper.NotSupportedTree(statementWithCtesAndXmlNamespaces); }
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) });
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); }
public override void ExplicitVisit(StatementWithCtesAndXmlNamespaces fragment) { _fragments.Add(fragment); }
internal ProcedureOutputSet(StatementWithCtesAndXmlNamespaces initiator) { this.initiator = initiator; }
public sealed override void ExplicitVisit(StatementWithCtesAndXmlNamespaces node) { base.ExplicitVisit(node); }
public StatementOutputColumnTypeResolverV1(BatchOutputColumnTypeResolver batchResolver, StatementWithCtesAndXmlNamespaces statement) { SchemaMetadata = batchResolver.SchemaMetadata; this.batchResolver = batchResolver; this.statement = statement; }
public override void ExplicitVisit(StatementWithCtesAndXmlNamespaces node) { this.action(node); }