Extension methods to SqlExpression
More...
Extension methods to SqlExpression
Definition at line 28 of file SqlExpressionExtensions.cs.
Definition at line 45 of file SqlExpressionExtensions.cs.
46 var constantExp = expression as SqlConstantExpression;
47 if (constantExp == null)
50 var value = constantExp.Value;
52 return ((SqlQueryObject) value.Value).QueryPlan;
static ObjectName Deveel.Data.Sql.Expressions.SqlExpressionExtensions.AsReferenceName |
( |
this SqlExpression |
expression | ) |
|
|
inlinestatic |
Extracts the name of the reference from the expression.
- Parameters
-
expression | The expression that encapsulates the reference |
- Returns
- Returns an ObjectName instance if the given expression is a SqlReferenceExpression, otherwise it returns
null
.
Definition at line 37 of file SqlExpressionExtensions.cs.
38 var refExpression = expression as SqlReferenceExpression;
39 if (refExpression == null)
42 return refExpression.ReferenceName;
Definition at line 87 of file SqlExpressionExtensions.cs.
88 return expression.EvaluateToConstant(
new EvaluateContext(request, variableResolver));
static bool Deveel.Data.Sql.Expressions.SqlExpressionExtensions.HasAggregate |
( |
this SqlExpression |
expression, |
|
|
IRequest |
query |
|
) |
| |
|
inlinestatic |
Verifies if the expression contains any aggregate function in the tree.
- Parameters
-
expression | The expression to verify. |
query | |
- Returns
- Returns
true
if the expression has any aggregate function in its tree, or false
otherwise.
Definition at line 118 of file SqlExpressionExtensions.cs.
119 var visitor =
new AggregateChecker(query);
120 return visitor.HasAggregate(expression);
static bool Deveel.Data.Sql.Expressions.SqlExpressionExtensions.IsConstant |
( |
this SqlExpression |
expression | ) |
|
|
inlinestatic |
Definition at line 123 of file SqlExpressionExtensions.cs.
124 var visitor =
new ConstantVisitor();
125 visitor.Visit(expression);
126 return visitor.IsConstant;
Gets the return type of the expression when evaluated.
- Parameters
-
expression | The expression to check. |
query | The query context used to evaluate the return type of the expression. |
variableResolver | The object used to resolve variable references in the expression tree. |
- Returns
- Returns the SqlType that an evaluation of the expression would return, or
null
if the final result of the evaluation has no return type.
Definition at line 103 of file SqlExpressionExtensions.cs.
104 var visitor =
new ReturnTypeVisitor(query, variableResolver);
105 return visitor.GetType(expression);
The documentation for this class was generated from the following file: