Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
21cafb2d
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
21cafb2d
编写于
5月 14, 2019
作者:
S
Serge Rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
SQLPlan adapter
上级
e925d1c9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
5 addition
and
3 deletion
+5
-3
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java
...s.sql/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java
+1
-1
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditorPropertyTester.java
...jkiss/dbeaver/ui/editors/sql/SQLEditorPropertyTester.java
+2
-1
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/plan/ExplainPlanViewer.java
.../jkiss/dbeaver/ui/editors/sql/plan/ExplainPlanViewer.java
+2
-1
未找到文件。
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java
浏览文件 @
21cafb2d
...
@@ -1528,7 +1528,7 @@ public class SQLEditor extends SQLEditorBase implements
...
@@ -1528,7 +1528,7 @@ public class SQLEditor extends SQLEditorBase implements
private
void
explainQueryPlan
(
SQLQuery
sqlQuery
)
private
void
explainQueryPlan
(
SQLQuery
sqlQuery
)
{
{
// 1. Determine whether planner supports plan extraction
// 1. Determine whether planner supports plan extraction
DBCQueryPlanner
planner
=
DBUtils
.
getAdapter
(
DBCQueryPlanner
.
class
,
getDataSource
()
);
DBCQueryPlanner
planner
=
GeneralUtils
.
adapt
(
getDataSource
(),
DBCQueryPlanner
.
class
);
if
(
planner
==
null
)
{
if
(
planner
==
null
)
{
DBWorkbench
.
getPlatformUI
().
showError
(
"Execution plan"
,
"Execution plan explain isn't supported by current datasource"
);
DBWorkbench
.
getPlatformUI
().
showError
(
"Execution plan"
,
"Execution plan explain isn't supported by current datasource"
);
return
;
return
;
...
...
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditorPropertyTester.java
浏览文件 @
21cafb2d
...
@@ -27,6 +27,7 @@ import org.jkiss.dbeaver.model.DBUtils;
...
@@ -27,6 +27,7 @@ import org.jkiss.dbeaver.model.DBUtils;
import
org.jkiss.dbeaver.model.exec.plan.DBCQueryPlanner
;
import
org.jkiss.dbeaver.model.exec.plan.DBCQueryPlanner
;
import
org.jkiss.dbeaver.ui.ActionUtils
;
import
org.jkiss.dbeaver.ui.ActionUtils
;
import
org.jkiss.dbeaver.ui.editors.text.parser.SQLIdentifierDetector
;
import
org.jkiss.dbeaver.ui.editors.text.parser.SQLIdentifierDetector
;
import
org.jkiss.dbeaver.utils.GeneralUtils
;
/**
/**
* SQLEditorPropertyTester
* SQLEditorPropertyTester
...
@@ -62,7 +63,7 @@ public class SQLEditorPropertyTester extends PropertyTester
...
@@ -62,7 +63,7 @@ public class SQLEditorPropertyTester extends PropertyTester
// Do not check hasActiveQuery - sometimes jface don't update action enablement after cursor change/typing
// Do not check hasActiveQuery - sometimes jface don't update action enablement after cursor change/typing
return
true
;
/* && (!"statement".equals(expectedValue) || editor.hasActiveQuery())*/
return
true
;
/* && (!"statement".equals(expectedValue) || editor.hasActiveQuery())*/
case
PROP_CAN_EXPLAIN:
case
PROP_CAN_EXPLAIN:
return
hasConnection
&&
DBUtils
.
getAdapter
(
DBCQueryPlanner
.
class
,
editor
.
getDataSource
()
)
!=
null
;
return
hasConnection
&&
GeneralUtils
.
adapt
(
editor
.
getDataSource
(),
DBCQueryPlanner
.
class
)
!=
null
;
case
PROP_CAN_NAVIGATE:
{
case
PROP_CAN_NAVIGATE:
{
// Check whether some word is under cursor
// Check whether some word is under cursor
ISelectionProvider
selectionProvider
=
editor
.
getSelectionProvider
();
ISelectionProvider
selectionProvider
=
editor
.
getSelectionProvider
();
...
...
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/plan/ExplainPlanViewer.java
浏览文件 @
21cafb2d
...
@@ -57,6 +57,7 @@ import org.jkiss.dbeaver.ui.editors.sql.internal.SQLEditorActivator;
...
@@ -57,6 +57,7 @@ import org.jkiss.dbeaver.ui.editors.sql.internal.SQLEditorActivator;
import
org.jkiss.dbeaver.ui.editors.sql.internal.SQLEditorMessages
;
import
org.jkiss.dbeaver.ui.editors.sql.internal.SQLEditorMessages
;
import
org.jkiss.dbeaver.ui.editors.sql.plan.registry.SQLPlanViewDescriptor
;
import
org.jkiss.dbeaver.ui.editors.sql.plan.registry.SQLPlanViewDescriptor
;
import
org.jkiss.dbeaver.ui.editors.sql.plan.registry.SQLPlanViewRegistry
;
import
org.jkiss.dbeaver.ui.editors.sql.plan.registry.SQLPlanViewRegistry
;
import
org.jkiss.dbeaver.utils.GeneralUtils
;
import
org.jkiss.utils.CommonUtils
;
import
org.jkiss.utils.CommonUtils
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.InvocationTargetException
;
...
@@ -228,7 +229,7 @@ public class ExplainPlanViewer extends Viewer implements IAdaptable
...
@@ -228,7 +229,7 @@ public class ExplainPlanViewer extends Viewer implements IAdaptable
DBCExecutionContext
executionContext
=
contextProvider
.
getExecutionContext
();
DBCExecutionContext
executionContext
=
contextProvider
.
getExecutionContext
();
if
(
executionContext
!=
null
)
{
if
(
executionContext
!=
null
)
{
DBPDataSource
dataSource
=
executionContext
.
getDataSource
();
DBPDataSource
dataSource
=
executionContext
.
getDataSource
();
planner
=
DBUtils
.
getAdapter
(
DBCQueryPlanner
.
class
,
dataSource
);
planner
=
GeneralUtils
.
adapt
(
dataSource
,
DBCQueryPlanner
.
class
);
}
else
{
}
else
{
planner
=
null
;
planner
=
null
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录