24 namespace Deveel.Data.Sql.Expressions {
39 if (refExpression == null)
47 if (constantExp == null)
50 var value = constantExp.
Value;
52 return ((SqlQueryObject) value.Value).QueryPlan;
76 var evalExp = expression.
Evaluate(context);
78 throw new InvalidOperationException();
81 if (constantExp == null)
82 throw new InvalidOperationException();
84 return constantExp.Value;
88 return expression.EvaluateToConstant(
new EvaluateContext(request, variableResolver));
105 return visitor.GetType(expression);
120 return visitor.HasAggregate(expression);
125 visitor.Visit(expression);
126 return visitor.IsConstant;
ObjectName ReferenceName
Gets the name of the object referenced by the expression.
An expression that references an object within a context.
static bool IsConstant(this SqlExpression expression)
static IQueryPlanNode AsQueryPlan(this SqlExpression expression)
Describes the name of an object within a database.
DataObject Value
Gets the constant value of the expression.
A node element of a query plan tree. /summary>
virtual SqlExpression Evaluate(EvaluateContext context)
When overridden by a derived class, this method evaluates the expression within the provided context...
Represents a dynamic object that encapsulates a defined SqlType and a compatible constant ISqlObject ...
Defines the properties of a specific SQL Type and handles the values compatible.
static SqlType ReturnType(this SqlExpression expression, IRequest query, IVariableResolver variableResolver)
Gets the return type of the expression when evaluated.
An interface to resolve a variable name to a constant object.
An expression that holds a constant value.
static ObjectName AsReferenceName(this SqlExpression expression)
Extracts the name of the reference from the expression.
Defines the base class for instances that represent SQL expression tree nodes.
Encapsulates the elements needed to evaluate an SqlExpression
Extension methods to SqlExpression
static DataObject EvaluateToConstant(this SqlExpression expression, IRequest request, IVariableResolver variableResolver)
static DataObject EvaluateToConstant(this SqlExpression expression, EvaluateContext context)
Evaluates the expression and reduces to a constant expression, whose value is then returned...
static bool HasAggregate(this SqlExpression expression, IRequest query)
Verifies if the expression contains any aggregate function in the tree.