25 namespace Deveel.Data.Routines {
28 var info = context.ResolveFunctionInfo(invoke);
37 var
function = context.ResolveFunction(invoke);
38 return function != null &&
function.FunctionType ==
FunctionType.Aggregate;
42 var routine = context.ResolveSystemRoutine(invoke);
44 routine = context.ResolveUserRoutine(invoke);
53 foreach (var resolver
in resolvers) {
63 var routine = context.Session().ResolveRoutine(invoke);
64 if (routine != null &&
65 !context.UserCanExecute(routine.Type, invoke))
66 throw new InvalidOperationException();
72 return context.ResolveRoutine(invoke) as
IFunction;
76 var invoke =
new Invoke(functionName, args);
77 return context.ResolveFunction(invoke);
81 return context.ResolveRoutineInfo(invoke) as
FunctionInfo;
85 var routine = context.ResolveRoutine(invoke);
89 return routine.RoutineInfo;
95 var invoke =
new Invoke(resolvedName, args);
96 return context.InvokeFunction(invoke);
100 var result = invoke.
Execute(context);
106 return context.InvokeFunction(
new Invoke(functionName, args));
110 var functionContext = context as IFunctionQueryContext;
111 if (functionContext == null)
112 throw new InvalidOperationException(
"Not in a FUNCTION scope.");
114 functionContext.SetReturn(expression);
The system uses instances of this interface to resolve routines given a user invocation.
static bool IsAggregateFunction(this IQueryContext context, Invoke invoke)
Defines a routine that is a function, that means it returns a value after its execution.
static bool IsSystemFunction(this IQueryContext context, Invoke invoke)
static DataObject InvokeFunction(this IQueryContext context, Invoke invoke)
static IFunction ResolveFunction(this IQueryContext context, Invoke invoke)
Provides a context for executing queries, accessing the system resources and evaluation context...
Describes the name of an object within a database.
The contract to define a program routine that can interact with database objects. ...
static RoutineInfo ResolveRoutineInfo(this IQueryContext context, Invoke invoke)
static DataObject InvokeSystemFunction(this IQueryContext context, string functionName, params SqlExpression[] args)
static readonly ObjectName SchemaName
The name of the system schema as ObjectName.
Represents a dynamic object that encapsulates a defined SqlType and a compatible constant ISqlObject ...
static IFunction ResolveFunction(this IQueryContext context, ObjectName functionName, params SqlExpression[] args)
The information about the invocation of a routine, including the full name and arguments (as SqlExpre...
DataObject ReturnValue
If the context of the result is a function, gets the return value of the function.
FunctionType
The different type of a function.
Provides utilities and properties for handling the SYSTEN schema of a database.
static IRoutine ResolveUserRoutine(this IQueryContext context, Invoke invoke)
The function signature information that are used to resolve a function within a context.
static FunctionInfo ResolveFunctionInfo(this IQueryContext context, Invoke invoke)
static DataObject InvokeFunction(this IQueryContext context, ObjectName functionName, params SqlExpression[] args)
static IRoutine ResolveSystemRoutine(this IQueryContext context, Invoke invoke)
IRoutine ResolveRoutine(Invoke request, IQuery query)
Resolves a routine that matches the given invocation within the context provided. ...
Defines the metadata for a routine that are used to resolve within a context.
static IRoutine ResolveRoutine(this IQueryContext context, Invoke invoke)
Defines the base class for instances that represent SQL expression tree nodes.
static void SetReturn(this IQueryContext context, SqlExpression expression)