DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Static Public Member Functions | List of all members
Deveel.Data.Routines.RoutineResolverExtensions Class Reference

Extension methods to any IRoutineResolver More...

Static Public Member Functions

static bool IsAggregateFunction (this IRoutineResolver resolver, Invoke request, IQuery query)
 Checks if a function matched against the given request represents an aggregate function. More...
 
static IFunction ResolveFunction (this FunctionProvider resolver, string name)
 
static IFunction ResolveFunction (this FunctionProvider resolver, IQuery context, string name)
 
static IFunction ResolveFunction (this FunctionProvider resolver, string name, params SqlExpression[] args)
 
static IFunction ResolveFunction (this FunctionProvider resolver, string name, params DataObject[] args)
 
static IFunction ResolveFunction (this FunctionProvider resolver, IQuery context, string name, params DataObject[] args)
 
static IFunction ResolveFunction (this FunctionProvider resolver, IQuery query, string name, SqlExpression[] args)
 

Detailed Description

Extension methods to any IRoutineResolver

Definition at line 27 of file RoutineResolverExtensions.cs.

Member Function Documentation

static bool Deveel.Data.Routines.RoutineResolverExtensions.IsAggregateFunction ( this IRoutineResolver  resolver,
Invoke  request,
IQuery  query 
)
inlinestatic

Checks if a function matched against the given request represents an aggregate function.

Parameters
resolverThe routine resolver.
requestThe invocation request used to resolve the function.
queryThe parent query context.
Returns
Returns true if a routine was resolved for the given request, this is a IFunction and the FunctionType is FunctionType.Aggregate, otherwise false.

Definition at line 40 of file RoutineResolverExtensions.cs.

40  {
41  var routine = resolver.ResolveRoutine(request, query);
42 
43  var function = routine as IFunction;
44  if (function == null)
45  return false;
46 
47  return function.FunctionType == FunctionType.Aggregate;
48  }
FunctionType
The different type of a function.
Definition: FunctionType.cs:25
static IFunction Deveel.Data.Routines.RoutineResolverExtensions.ResolveFunction ( this FunctionProvider  resolver,
string  name 
)
inlinestatic

Definition at line 50 of file RoutineResolverExtensions.cs.

50  {
51  return ResolveFunction(resolver, null, name);
52  }
static IFunction ResolveFunction(this FunctionProvider resolver, string name)
static IFunction Deveel.Data.Routines.RoutineResolverExtensions.ResolveFunction ( this FunctionProvider  resolver,
IQuery  context,
string  name 
)
inlinestatic

Definition at line 54 of file RoutineResolverExtensions.cs.

54  {
55  return ResolveFunction(resolver, context, name, new SqlExpression[0]);
56  }
static IFunction ResolveFunction(this FunctionProvider resolver, string name)
Defines the base class for instances that represent SQL expression tree nodes.
static IFunction Deveel.Data.Routines.RoutineResolverExtensions.ResolveFunction ( this FunctionProvider  resolver,
string  name,
params SqlExpression[]  args 
)
inlinestatic

Definition at line 58 of file RoutineResolverExtensions.cs.

58  {
59  return ResolveFunction(resolver, null, name, args);
60  }
static IFunction ResolveFunction(this FunctionProvider resolver, string name)
static IFunction Deveel.Data.Routines.RoutineResolverExtensions.ResolveFunction ( this FunctionProvider  resolver,
string  name,
params DataObject[]  args 
)
inlinestatic

Definition at line 62 of file RoutineResolverExtensions.cs.

62  {
63  return ResolveFunction(resolver, null, name, args);
64  }
static IFunction ResolveFunction(this FunctionProvider resolver, string name)
static IFunction Deveel.Data.Routines.RoutineResolverExtensions.ResolveFunction ( this FunctionProvider  resolver,
IQuery  context,
string  name,
params DataObject[]  args 
)
inlinestatic

Definition at line 66 of file RoutineResolverExtensions.cs.

66  {
67  var exps = new SqlExpression[0];
68  if (args != null && args.Length > 0) {
69  exps = new SqlExpression[args.Length];
70  for (int i = 0; i < args.Length; i++) {
71  exps[i] = SqlExpression.Constant(args[i]);
72  }
73  }
74 
75  return resolver.ResolveFunction(context, name, exps);
76  }
Defines the base class for instances that represent SQL expression tree nodes.
static SqlConstantExpression Constant(object value)
static IFunction Deveel.Data.Routines.RoutineResolverExtensions.ResolveFunction ( this FunctionProvider  resolver,
IQuery  query,
string  name,
SqlExpression[]  args 
)
inlinestatic

Definition at line 78 of file RoutineResolverExtensions.cs.

78  {
79  var funName = new ObjectName(new ObjectName(resolver.SchemaName), name);
80  var routine = ((IRoutineResolver) resolver).ResolveRoutine(new Invoke(funName, args), query);
81  if (!(routine is IFunction))
82  throw new InvalidOperationException();
83 
84  return routine as IFunction;
85  }
Describes the name of an object within a database.
Definition: ObjectName.cs:44

The documentation for this class was generated from the following file: