|
static bool | ViewExists (this IQuery context, ObjectName viewName) |
|
static void | DefineView (this IQuery context, ViewInfo viewInfo, bool replaceIfExists) |
|
static void | DefineView (this IQuery context, ObjectName viewName, IQueryPlanNode queryPlan, bool replaceIfExists) |
|
static void | DropView (this IQuery context, ObjectName viewName) |
|
static void | DropView (this IQuery context, ObjectName viewName, bool ifExists) |
|
static void | DropViews (this IQuery context, IEnumerable< ObjectName > viewNames) |
|
static void | DropViews (this IQuery context, IEnumerable< ObjectName > viewNames, bool onlyIfExists) |
|
static View | GetView (this IQuery context, ObjectName viewName) |
|
static IQueryPlanNode | GetViewQueryPlan (this IQuery context, ObjectName viewName) |
|
Definition at line 26 of file QueryExtensions.cs.
static void Deveel.Data.Sql.Views.QueryExtensions.DefineView |
( |
this IQuery |
context, |
|
|
ViewInfo |
viewInfo, |
|
|
bool |
replaceIfExists |
|
) |
| |
|
inlinestatic |
Definition at line 31 of file QueryExtensions.cs.
32 var tablesInPlan = viewInfo.QueryPlan.DiscoverTableNames();
33 foreach (var tableName
in tablesInPlan) {
34 if (!context.UserCanSelectFromTable(tableName))
38 if (context.ViewExists(viewInfo.ViewName)) {
40 throw new InvalidOperationException(
41 String.Format(
"The view {0} already exists and the REPLCE clause was not specified.", viewInfo.ViewName));
43 context.DropObject(
DbObjectType.View, viewInfo.ViewName);
46 context.CreateObject(viewInfo);
50 using (var systemContext = context.Direct()) {
51 systemContext.GrantToUserOnTable(viewInfo.ViewName, context.UserName(),
Privileges.TableAll);
A long string in the system.
DbObjectType
The kind of objects that can be handled by a database system and its managers
static void Deveel.Data.Sql.Views.QueryExtensions.DefineView |
( |
this IQuery |
context, |
|
|
ObjectName |
viewName, |
|
|
IQueryPlanNode |
queryPlan, |
|
|
bool |
replaceIfExists |
|
) |
| |
|
inlinestatic |
Definition at line 55 of file QueryExtensions.cs.
58 var table = queryPlan.
Evaluate(context);
59 var tableInfo = table.TableInfo.Alias(viewName);
61 var viewInfo =
new ViewInfo(tableInfo, null, queryPlan);
62 context.DefineView(viewInfo, replaceIfExists);
ITable Evaluate(IRequest context)
static void Deveel.Data.Sql.Views.QueryExtensions.DropView |
( |
this IQuery |
context, |
|
|
ObjectName |
viewName |
|
) |
| |
|
inlinestatic |
Definition at line 65 of file QueryExtensions.cs.
static void DropView(this IQuery context, ObjectName viewName)
static void Deveel.Data.Sql.Views.QueryExtensions.DropView |
( |
this IQuery |
context, |
|
|
ObjectName |
viewName, |
|
|
bool |
ifExists |
|
) |
| |
|
inlinestatic |
Definition at line 69 of file QueryExtensions.cs.
70 context.DropViews(
new[] { viewName }, ifExists);
static void Deveel.Data.Sql.Views.QueryExtensions.DropViews |
( |
this IQuery |
context, |
|
|
IEnumerable< ObjectName > |
viewNames |
|
) |
| |
|
inlinestatic |
Definition at line 73 of file QueryExtensions.cs.
static void DropViews(this IQuery context, IEnumerable< ObjectName > viewNames)
static void Deveel.Data.Sql.Views.QueryExtensions.DropViews |
( |
this IQuery |
context, |
|
|
IEnumerable< ObjectName > |
viewNames, |
|
|
bool |
onlyIfExists |
|
) |
| |
|
inlinestatic |
Definition at line 77 of file QueryExtensions.cs.
78 var viewNameList = viewNames.ToList();
79 foreach (var tableName
in viewNameList) {
80 if (!context.UserCanDropObject(
DbObjectType.View, tableName))
88 foreach (var viewName
in viewNameList) {
90 if (!context.ViewExists(viewName)) {
91 throw new ObjectNotFoundException(viewName,
String.Format(
"The view '{0}' does not exist and cannot be dropped.", viewName));
96 foreach (var viewName
in viewNameList) {
98 if (context.ViewExists(viewName)) {
103 context.RevokeAllGrantsOnView(viewName);
A long string in the system.
DbObjectType
The kind of objects that can be handled by a database system and its managers
static View Deveel.Data.Sql.Views.QueryExtensions.GetView |
( |
this IQuery |
context, |
|
|
ObjectName |
viewName |
|
) |
| |
|
inlinestatic |
Definition at line 108 of file QueryExtensions.cs.
A VIEW object obtained by a source query.
DbObjectType
The kind of objects that can be handled by a database system and its managers
Definition at line 112 of file QueryExtensions.cs.
113 var view = context.GetView(viewName);
114 return view == null ? null : view.QueryPlan;
static bool Deveel.Data.Sql.Views.QueryExtensions.ViewExists |
( |
this IQuery |
context, |
|
|
ObjectName |
viewName |
|
) |
| |
|
inlinestatic |
Definition at line 27 of file QueryExtensions.cs.
28 return context.ObjectExists(
DbObjectType.View, viewName);
DbObjectType
The kind of objects that can be handled by a database system and its managers
The documentation for this class was generated from the following file:
- /var/calculate/remote/distfiles/egit-src/deveeldb.git/src/deveeldb/Deveel.Data.Sql.Views/QueryExtensions.cs