25 namespace Deveel.Data.Routines {
51 RoutineName = routineName;
52 Arguments = arguments;
73 public bool IsGlobArgument {
75 return Arguments != null &&
76 Arguments.Length == 1 &&
92 if (query.
Query.IsAggregateFunction(
this))
96 return Arguments.Any(x => x.HasAggregate(query));
119 if (context == null) {
122 cached = context.
Query.ResolveRoutine(
this);
126 throw new InvalidOperationException(String.Format(
"Unable to resolve the call {0} to a function",
this));
132 return ResolveRoutine(context) as
IFunction;
148 return ResolveRoutine(null) as
IFunction;
152 return Execute(null);
156 return Execute(query, null);
160 return Execute(query, resolver, null);
164 var routine = ResolveRoutine(query);
165 var executeContext =
new InvokeContext(
this, routine, resolver, group, query);
166 return routine.Execute(executeContext);
170 var buf =
new StringBuilder();
171 buf.Append(RoutineName);
173 for (
int i = 0; i < Arguments.Length; ++i) {
174 buf.Append(Arguments[i]);
175 if (i < Arguments.Length - 1) {
180 return buf.ToString();
IFunction ResolveFunction(IQuery context)
Invoke(ObjectName routineName, SqlExpression[] arguments)
Constructs a new Invoke with the given name of the routine and the arguments.
Defines a routine that is a function, that means it returns a value after its execution.
IRoutine ResolveRoutine(IRequest context)
Resolves the routine target of the invocation within the give context.
bool IsAggregate(IRequest query)
Checks if the target of the invocation is an aggregate function.
InvokeResult Execute(IRequest query, IVariableResolver resolver)
InvokeResult Execute(IRequest query)
Describes the name of an object within a database.
The contract to define a program routine that can interact with database objects. ...
ISqlObject Value
Gets the underlined value that is handled.
Invoke(ObjectName routineName)
Constructs a new Invoke with the given name of the routine and no arguments.
DataObject Value
Gets the constant value of the expression.
Defines a contract used by grouping functions to find information about the current group being evalu...
Represents the result of the execution of a routine.
The information about the invocation of a routine, including the full name and arguments (as SqlExpre...
A specific kind of routine that does not return any value when executed.
An interface to resolve a variable name to a constant object.
An expression that holds a constant value.
IFunction ResolveFunction(Invoke invoke, IQuery query)
InvokeResult Execute(IRequest query, IVariableResolver resolver, IGroupResolver group)
Defines the base class for instances that represent SQL expression tree nodes.
override String ToString()
IFunction ResolveSystemFunction()
Resolves this routine invocation to a system function.
static FunctionProvider Provider
IProcedure ResolveProcedure(IQuery context)