|
static bool | ViewExists (this IQueryContext context, ObjectName viewName) |
|
static void | DefineView (this IQueryContext context, ViewInfo viewInfo, bool replaceIfExists) |
|
static void | DefineView (this IQueryContext context, ObjectName viewName, IQueryPlanNode queryPlan, bool replaceIfExists) |
|
static void | DropView (this IQueryContext context, ObjectName viewName) |
|
static void | DropView (this IQueryContext context, ObjectName viewName, bool ifExists) |
|
static void | DropViews (this IQueryContext context, IEnumerable< ObjectName > viewNames) |
|
static void | DropViews (this IQueryContext context, IEnumerable< ObjectName > viewNames, bool onlyIfExists) |
|
static View | GetView (this IQueryContext context, ObjectName viewName) |
|
static IQueryPlanNode | GetViewQueryPlan (this IQueryContext context, ObjectName viewName) |
|
Definition at line 10 of file QueryContext.Views.cs.
static void Deveel.Data.Sql.Views.QueryContextExtensions.DefineView |
( |
this IQueryContext |
context, |
|
|
ViewInfo |
viewInfo, |
|
|
bool |
replaceIfExists |
|
) |
| |
|
inlinestatic |
Definition at line 15 of file QueryContext.Views.cs.
16 var tablesInPlan = viewInfo.QueryPlan.DiscoverTableNames();
17 foreach (var tableName
in tablesInPlan) {
18 if (!context.UserCanSelectFromTable(tableName))
22 if (context.ViewExists(viewInfo.ViewName)) {
24 throw new InvalidOperationException(
25 String.Format(
"The view {0} already exists and the REPLCE clause was not specified.", viewInfo.ViewName));
27 context.DropObject(
DbObjectType.View, viewInfo.ViewName);
30 context.CreateObject(viewInfo);
34 using (var systemContext = context.ForSystemUser()) {
35 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
Definition at line 39 of file QueryContext.Views.cs.
42 var table = queryPlan.
Evaluate(context);
43 var tableInfo = table.TableInfo.Alias(viewName);
45 var viewInfo =
new ViewInfo(tableInfo, null, queryPlan);
46 context.DefineView(viewInfo, replaceIfExists);
ITable Evaluate(IRequest context)
static void Deveel.Data.Sql.Views.QueryContextExtensions.DropView |
( |
this IQueryContext |
context, |
|
|
ObjectName |
viewName |
|
) |
| |
|
inlinestatic |
Definition at line 49 of file QueryContext.Views.cs.
static void DropView(this IQueryContext context, ObjectName viewName)
static void Deveel.Data.Sql.Views.QueryContextExtensions.DropView |
( |
this IQueryContext |
context, |
|
|
ObjectName |
viewName, |
|
|
bool |
ifExists |
|
) |
| |
|
inlinestatic |
static void Deveel.Data.Sql.Views.QueryContextExtensions.DropViews |
( |
this IQueryContext |
context, |
|
|
IEnumerable< ObjectName > |
viewNames |
|
) |
| |
|
inlinestatic |
Definition at line 57 of file QueryContext.Views.cs.
static void DropViews(this IQueryContext context, IEnumerable< ObjectName > viewNames)
static void Deveel.Data.Sql.Views.QueryContextExtensions.DropViews |
( |
this IQueryContext |
context, |
|
|
IEnumerable< ObjectName > |
viewNames, |
|
|
bool |
onlyIfExists |
|
) |
| |
|
inlinestatic |
Definition at line 61 of file QueryContext.Views.cs.
62 var viewNameList = viewNames.ToList();
63 foreach (var tableName
in viewNameList) {
64 if (!context.UserCanDropObject(
DbObjectType.View, tableName))
72 foreach (var viewName
in viewNameList) {
74 if (!context.ViewExists(viewName)) {
75 throw new ObjectNotFoundException(viewName,
String.Format(
"The view '{0}' does not exist and cannot be dropped.", viewName));
80 foreach (var viewName
in viewNameList) {
82 if (context.ViewExists(viewName)) {
87 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
Definition at line 92 of file QueryContext.Views.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 96 of file QueryContext.Views.cs.
97 var view = context.GetView(viewName);
98 return view == null ? null : view.QueryPlan;
static bool Deveel.Data.Sql.Views.QueryContextExtensions.ViewExists |
( |
this IQueryContext |
context, |
|
|
ObjectName |
viewName |
|
) |
| |
|
inlinestatic |
Definition at line 11 of file QueryContext.Views.cs.
12 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/QueryContext.Views.cs