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

Static Public Member Functions

static bool DeclareCursor (this IContext context, CursorInfo cursorInfo)
 
static void DeclareCursor (this IContext context, string cursorName, SqlQueryExpression query)
 
static void DeclareCursor (this IContext context, string cursorName, CursorFlags flags, SqlQueryExpression query)
 
static void DeclareInsensitiveCursor (this IContext context, string cursorName, SqlQueryExpression query)
 
static void DeclareInsensitiveCursor (this IContext context, string cursorName, SqlQueryExpression query, bool withScroll)
 
static bool CursorExists (this IContext context, string cursorName)
 
static Cursor FindCursor (this IContext context, string cursorName)
 
static bool DropCursor (this IContext context, string cursorName)
 
static bool CloseCursor (this IContext context, string cursorName)
 
static bool OpenCursor (this IContext context, IRequest request, string cursorName, params SqlExpression[] args)
 

Detailed Description

Definition at line 23 of file ContextExtensions.cs.

Member Function Documentation

static bool Deveel.Data.Sql.Cursors.ContextExtensions.CloseCursor ( this IContext  context,
string  cursorName 
)
inlinestatic

Definition at line 110 of file ContextExtensions.cs.

110  {
111  var cursor = context.FindCursor(cursorName);
112  if (cursor == null)
113  return false;
114 
115  cursor.Close();
116  return true;
117  }
static bool Deveel.Data.Sql.Cursors.ContextExtensions.CursorExists ( this IContext  context,
string  cursorName 
)
inlinestatic

Definition at line 64 of file ContextExtensions.cs.

64  {
65  var currentContext = context;
66  while (currentContext != null) {
67  if (currentContext is ICursorScope) {
68  var scope = (ICursorScope) currentContext;
69  if (scope.CursorExists(cursorName))
70  return true;
71  }
72 
73  currentContext = currentContext.Parent;
74  }
75 
76  return false;
77  }
static bool Deveel.Data.Sql.Cursors.ContextExtensions.DeclareCursor ( this IContext  context,
CursorInfo  cursorInfo 
)
inlinestatic

Definition at line 24 of file ContextExtensions.cs.

24  {
25  if (context.CursorExists(cursorInfo.CursorName))
26  throw new InvalidOperationException(String.Format("A cursor named '{0}' was already defined in the context.",
27  cursorInfo.CursorName));
28 
29  var currentContext = context;
30  while (currentContext != null) {
31  if (currentContext is ICursorScope) {
32  var scope = (ICursorScope)currentContext;
33  scope.DeclareCursor(cursorInfo);
34  return true;
35  }
36 
37  currentContext = currentContext.Parent;
38  }
39 
40  return false;
41  }
A long string in the system.
static void Deveel.Data.Sql.Cursors.ContextExtensions.DeclareCursor ( this IContext  context,
string  cursorName,
SqlQueryExpression  query 
)
inlinestatic

Definition at line 43 of file ContextExtensions.cs.

43  {
44  DeclareCursor(context, cursorName, (CursorFlags)0, query);
45  }
static bool DeclareCursor(this IContext context, CursorInfo cursorInfo)
static void Deveel.Data.Sql.Cursors.ContextExtensions.DeclareCursor ( this IContext  context,
string  cursorName,
CursorFlags  flags,
SqlQueryExpression  query 
)
inlinestatic

Definition at line 47 of file ContextExtensions.cs.

47  {
48  context.DeclareCursor(new CursorInfo(cursorName, flags, query));
49  }
static void Deveel.Data.Sql.Cursors.ContextExtensions.DeclareInsensitiveCursor ( this IContext  context,
string  cursorName,
SqlQueryExpression  query 
)
inlinestatic

Definition at line 51 of file ContextExtensions.cs.

51  {
52  DeclareInsensitiveCursor(context, cursorName, query, false);
53  }
static void DeclareInsensitiveCursor(this IContext context, string cursorName, SqlQueryExpression query)
static void Deveel.Data.Sql.Cursors.ContextExtensions.DeclareInsensitiveCursor ( this IContext  context,
string  cursorName,
SqlQueryExpression  query,
bool  withScroll 
)
inlinestatic

Definition at line 55 of file ContextExtensions.cs.

55  {
56  var flags = CursorFlags.Insensitive;
57  if (withScroll)
58  flags |= CursorFlags.Scroll;
59 
60  context.DeclareCursor(cursorName, flags, query);
61  }
static bool Deveel.Data.Sql.Cursors.ContextExtensions.DropCursor ( this IContext  context,
string  cursorName 
)
inlinestatic

Definition at line 95 of file ContextExtensions.cs.

95  {
96  var currentContext = context;
97  while (currentContext != null) {
98  if (currentContext is ICursorScope) {
99  var scope = (ICursorScope)currentContext;
100  if (scope.CursorExists(cursorName))
101  return scope.DropCursor(cursorName);
102  }
103 
104  currentContext = currentContext.Parent;
105  }
106 
107  return false;
108  }
static Cursor Deveel.Data.Sql.Cursors.ContextExtensions.FindCursor ( this IContext  context,
string  cursorName 
)
inlinestatic

Definition at line 79 of file ContextExtensions.cs.

79  {
80  var currentContext = context;
81  while (currentContext != null) {
82  if (currentContext is ICursorScope) {
83  var scope = (ICursorScope)currentContext;
84  var cursor = scope.GetCursor(cursorName);
85  if (cursor != null)
86  return cursor;
87  }
88 
89  currentContext = currentContext.Parent;
90  }
91 
92  return null;
93  }
static bool Deveel.Data.Sql.Cursors.ContextExtensions.OpenCursor ( this IContext  context,
IRequest  request,
string  cursorName,
params SqlExpression[]  args 
)
inlinestatic

Definition at line 119 of file ContextExtensions.cs.

119  {
120  var cursor = context.FindCursor(cursorName);
121  if (cursor == null)
122  return false;
123 
124  // TODO: support the evaluate in context (and not just IQueryContext)
125  throw new NotImplementedException();
126  }

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