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

Static Public Member Functions

static bool IsSystemFunction (this IQuery query, Invoke invoke)
 
static bool IsAggregateFunction (this IQuery query, Invoke invoke)
 
static IRoutine ResolveRoutine (this IQuery query, Invoke invoke)
 
static IRoutine ResolveSystemRoutine (this IQuery query, Invoke invoke)
 
static IRoutine ResolveUserRoutine (this IQuery query, Invoke invoke)
 
static IFunction ResolveFunction (this IQuery query, Invoke invoke)
 
static IFunction ResolveFunction (this IQuery query, ObjectName functionName, params SqlExpression[] args)
 
static FunctionInfo ResolveFunctionInfo (this IQuery query, Invoke invoke)
 
static RoutineInfo ResolveRoutineInfo (this IQuery query, Invoke invoke)
 
static DataObject InvokeSystemFunction (this IQuery query, string functionName, params SqlExpression[] args)
 
static DataObject InvokeFunction (this IQuery query, Invoke invoke)
 
static DataObject InvokeFunction (this IQuery query, ObjectName functionName, params SqlExpression[] args)
 

Detailed Description

Definition at line 25 of file Query.Routines.cs.

Member Function Documentation

static DataObject Deveel.Data.Routines.Query.InvokeFunction ( this IQuery  query,
Invoke  invoke 
)
inlinestatic

Definition at line 98 of file Query.Routines.cs.

98  {
99  var result = invoke.Execute(query);
100  return result.ReturnValue;
101  }
static DataObject Deveel.Data.Routines.Query.InvokeFunction ( this IQuery  query,
ObjectName  functionName,
params SqlExpression[]  args 
)
inlinestatic

Definition at line 103 of file Query.Routines.cs.

104  {
105  return query.InvokeFunction(new Invoke(functionName, args));
106  }
static DataObject Deveel.Data.Routines.Query.InvokeSystemFunction ( this IQuery  query,
string  functionName,
params SqlExpression[]  args 
)
inlinestatic

Definition at line 91 of file Query.Routines.cs.

92  {
93  var resolvedName = new ObjectName(SystemSchema.SchemaName, functionName);
94  var invoke = new Invoke(resolvedName, args);
95  return query.InvokeFunction(invoke);
96  }
Describes the name of an object within a database.
Definition: ObjectName.cs:44
static bool Deveel.Data.Routines.Query.IsAggregateFunction ( this IQuery  query,
Invoke  invoke 
)
inlinestatic

Definition at line 35 of file Query.Routines.cs.

35  {
36  var function = query.ResolveFunction(invoke);
37  return function != null && function.FunctionType == FunctionType.Aggregate;
38  }
FunctionType
The different type of a function.
Definition: FunctionType.cs:25
static bool Deveel.Data.Routines.Query.IsSystemFunction ( this IQuery  query,
Invoke  invoke 
)
inlinestatic

Definition at line 26 of file Query.Routines.cs.

26  {
27  var info = query.ResolveFunctionInfo(invoke);
28  if (info == null)
29  return false;
30 
31  return info.FunctionType != FunctionType.External &&
32  info.FunctionType != FunctionType.UserDefined;
33  }
FunctionType
The different type of a function.
Definition: FunctionType.cs:25
static IFunction Deveel.Data.Routines.Query.ResolveFunction ( this IQuery  query,
Invoke  invoke 
)
inlinestatic

Definition at line 70 of file Query.Routines.cs.

70  {
71  return query.ResolveRoutine(invoke) as IFunction;
72  }
static IFunction Deveel.Data.Routines.Query.ResolveFunction ( this IQuery  query,
ObjectName  functionName,
params SqlExpression[]  args 
)
inlinestatic

Definition at line 74 of file Query.Routines.cs.

74  {
75  var invoke = new Invoke(functionName, args);
76  return query.ResolveFunction(invoke);
77  }
static FunctionInfo Deveel.Data.Routines.Query.ResolveFunctionInfo ( this IQuery  query,
Invoke  invoke 
)
inlinestatic

Definition at line 79 of file Query.Routines.cs.

79  {
80  return query.ResolveRoutineInfo(invoke) as FunctionInfo;
81  }
static IRoutine Deveel.Data.Routines.Query.ResolveRoutine ( this IQuery  query,
Invoke  invoke 
)
inlinestatic

Definition at line 40 of file Query.Routines.cs.

40  {
41  var routine = query.ResolveSystemRoutine(invoke);
42  if (routine == null)
43  routine = query.ResolveUserRoutine(invoke);
44 
45  return routine;
46  }
static RoutineInfo Deveel.Data.Routines.Query.ResolveRoutineInfo ( this IQuery  query,
Invoke  invoke 
)
inlinestatic

Definition at line 83 of file Query.Routines.cs.

83  {
84  var routine = query.ResolveRoutine(invoke);
85  if (routine == null)
86  return null;
87 
88  return routine.RoutineInfo;
89  }
static IRoutine Deveel.Data.Routines.Query.ResolveSystemRoutine ( this IQuery  query,
Invoke  invoke 
)
inlinestatic

Definition at line 48 of file Query.Routines.cs.

48  {
49  // return query.SystemContext().ResolveRoutine(invoke, query);
50 
51  var resolvers = query.Context.ResolveAllServices<IRoutineResolver>();
52  foreach (var resolver in resolvers) {
53  var routine = resolver.ResolveRoutine(invoke, query);
54  if (routine != null)
55  return routine;
56  }
57 
58  return null;
59  }
static IRoutine Deveel.Data.Routines.Query.ResolveUserRoutine ( this IQuery  query,
Invoke  invoke 
)
inlinestatic

Definition at line 61 of file Query.Routines.cs.

61  {
62  var routine = query.Session.ResolveRoutine(invoke);
63  if (routine != null &&
64  !query.UserCanExecute(routine.Type, invoke))
65  throw new InvalidOperationException();
66 
67  return routine;
68  }

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