Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
cd187d6b
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,发现更多精彩内容 >>
提交
cd187d6b
编写于
6月 20, 2018
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#3644 PG: materialized view tablespace. Comment editor fix.
Former-commit-id:
93ac380f
上级
34f7e599
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
53 addition
and
25 deletion
+53
-25
plugins/org.jkiss.dbeaver.ext.postgresql/OSGI-INF/l10n/bundle.properties
...ss.dbeaver.ext.postgresql/OSGI-INF/l10n/bundle.properties
+2
-0
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/edit/PostgreTableManagerBase.java
.../dbeaver/ext/postgresql/edit/PostgreTableManagerBase.java
+1
-1
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/edit/PostgreViewManager.java
...jkiss/dbeaver/ext/postgresql/edit/PostgreViewManager.java
+1
-1
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreMaterializedView.java
...dbeaver/ext/postgresql/model/PostgreMaterializedView.java
+22
-0
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreTable.java
.../org/jkiss/dbeaver/ext/postgresql/model/PostgreTable.java
+0
-19
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreTableBase.java
.../jkiss/dbeaver/ext/postgresql/model/PostgreTableBase.java
+26
-3
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreViewBase.java
...g/jkiss/dbeaver/ext/postgresql/model/PostgreViewBase.java
+1
-1
未找到文件。
plugins/org.jkiss.dbeaver.ext.postgresql/OSGI-INF/l10n/bundle.properties
浏览文件 @
cd187d6b
...
...
@@ -399,6 +399,8 @@ meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreViewBase.name.name=Name
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreViewBase.name.description
=
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreViewBase.objectDefinitionText.name
=
Source
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreViewBase.objectDefinitionText.description
=
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreMaterializedView.tablespace.name
=
Tablespace
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreMaterializedView.tablespace.description
=
Materialized view tablespace
meta.org.jkiss.dbeaver.ext.postgresql.model.plan.PostgrePlanNode.cost.name
=
Cost
meta.org.jkiss.dbeaver.ext.postgresql.model.plan.PostgrePlanNode.cost.description
=
meta.org.jkiss.dbeaver.ext.postgresql.model.plan.PostgrePlanNode.entity.name
=
Entity
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/edit/PostgreTableManagerBase.java
浏览文件 @
cd187d6b
...
...
@@ -59,7 +59,7 @@ public abstract class PostgreTableManagerBase extends SQLTableManager<PostgreTab
if
(
showComments
&&
comment
!=
null
)
{
actions
.
add
(
new
SQLDatabasePersistAction
(
"Comment table"
,
"COMMENT ON "
+
(
table
.
isView
()
?
"VIEW"
:
"TABLE"
)
+
" "
+
table
.
getFullyQualifiedName
(
DBPEvaluationContext
.
DDL
)
+
"COMMENT ON "
+
(
table
.
isView
()
?
((
PostgreViewBase
)
table
).
getViewType
()
:
"TABLE"
)
+
" "
+
table
.
getFullyQualifiedName
(
DBPEvaluationContext
.
DDL
)
+
" IS "
+
SQLUtils
.
quoteString
(
table
,
comment
)));
}
DBRProgressMonitor
monitor
=
new
VoidProgressMonitor
();
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/edit/PostgreViewManager.java
浏览文件 @
cd187d6b
...
...
@@ -113,7 +113,7 @@ public class PostgreViewManager extends PostgreTableManagerBase {
// Source may be empty if it wasn't yet read. Then it definitely wasn't changed
String
sql
=
view
.
getSource
().
trim
();
if
(!
sql
.
toLowerCase
(
Locale
.
ENGLISH
).
startsWith
(
"create"
))
{
sql
=
"CREATE OR REPLACE
VIEW
"
+
DBUtils
.
getObjectFullName
(
view
,
DBPEvaluationContext
.
DDL
)
+
" AS\n"
+
sql
;
sql
=
"CREATE OR REPLACE
"
+
view
.
getViewType
()
+
"
"
+
DBUtils
.
getObjectFullName
(
view
,
DBPEvaluationContext
.
DDL
)
+
" AS\n"
+
sql
;
}
actions
.
add
(
new
SQLDatabasePersistAction
(
"Create view"
,
sql
));
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreMaterializedView.java
浏览文件 @
cd187d6b
...
...
@@ -17,8 +17,14 @@
package
org.jkiss.dbeaver.ext.postgresql.model
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.ext.postgresql.PostgreUtils
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCSession
;
import
org.jkiss.dbeaver.model.impl.jdbc.JDBCUtils
;
import
org.jkiss.dbeaver.model.meta.IPropertyValueListProvider
;
import
org.jkiss.dbeaver.model.meta.Property
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.runtime.VoidProgressMonitor
;
import
org.jkiss.utils.CommonUtils
;
import
java.sql.ResultSet
;
...
...
@@ -30,6 +36,8 @@ import java.util.Map;
*/
public
class
PostgreMaterializedView
extends
PostgreViewBase
{
private
long
tablespaceId
;
public
PostgreMaterializedView
(
PostgreSchema
catalog
)
{
super
(
catalog
);
}
...
...
@@ -39,6 +47,7 @@ public class PostgreMaterializedView extends PostgreViewBase
ResultSet
dbResult
)
{
super
(
catalog
,
dbResult
);
this
.
tablespaceId
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"reltablespace"
);
}
@Override
...
...
@@ -65,4 +74,17 @@ public class PostgreMaterializedView extends PostgreViewBase
return
"MATERIALIZED VIEW"
;
}
@Property
(
viewable
=
true
,
editable
=
true
,
updatable
=
true
,
order
=
20
,
listProvider
=
PostgreTableBase
.
TablespaceListProvider
.
class
)
public
PostgreTablespace
getTablespace
(
DBRProgressMonitor
monitor
)
throws
DBException
{
if
(
tablespaceId
==
0
)
{
return
getDatabase
().
getDefaultTablespace
(
monitor
);
}
return
PostgreUtils
.
getObjectById
(
monitor
,
getDatabase
().
tablespaceCache
,
getDatabase
(),
tablespaceId
);
}
public
void
setTablespace
(
PostgreTablespace
tablespace
)
{
this
.
tablespaceId
=
tablespace
.
getObjectId
();
}
}
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreTable.java
浏览文件 @
cd187d6b
...
...
@@ -318,23 +318,4 @@ public abstract class PostgreTable extends PostgreTableReal implements DBDPseudo
return
result
;
}
public
static
class
TablespaceListProvider
implements
IPropertyValueListProvider
<
PostgreTable
>
{
@Override
public
boolean
allowCustomValue
()
{
return
false
;
}
@Override
public
Object
[]
getPossibleValues
(
PostgreTable
object
)
{
try
{
Collection
<
PostgreTablespace
>
tablespaces
=
object
.
getDatabase
().
getTablespaces
(
new
VoidProgressMonitor
());
return
tablespaces
.
toArray
(
new
Object
[
tablespaces
.
size
()]);
}
catch
(
DBException
e
)
{
log
.
error
(
e
);
return
new
Object
[
0
];
}
}
}
}
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreTableBase.java
浏览文件 @
cd187d6b
...
...
@@ -19,6 +19,7 @@ package org.jkiss.dbeaver.ext.postgresql.model;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.ext.postgresql.PostgreUtils
;
import
org.jkiss.dbeaver.model.DBPEvaluationContext
;
import
org.jkiss.dbeaver.model.DBPNamedObject2
;
...
...
@@ -28,8 +29,10 @@ import org.jkiss.dbeaver.model.impl.jdbc.JDBCUtils;
import
org.jkiss.dbeaver.model.impl.jdbc.cache.JDBCStructCache
;
import
org.jkiss.dbeaver.model.impl.jdbc.struct.JDBCTable
;
import
org.jkiss.dbeaver.model.meta.Association
;
import
org.jkiss.dbeaver.model.meta.IPropertyValueListProvider
;
import
org.jkiss.dbeaver.model.meta.Property
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.runtime.VoidProgressMonitor
;
import
org.jkiss.dbeaver.model.struct.DBSEntity
;
import
org.jkiss.dbeaver.model.struct.DBSEntityAssociation
;
import
org.jkiss.dbeaver.model.struct.DBSObject
;
...
...
@@ -43,6 +46,8 @@ import java.util.*;
*/
public
abstract
class
PostgreTableBase
extends
JDBCTable
<
PostgreDataSource
,
PostgreSchema
>
implements
PostgreClass
,
PostgreScriptObject
,
PostgrePermissionsOwner
,
DBPNamedObject2
{
private
static
final
Log
log
=
Log
.
getLog
(
PostgreTableBase
.
class
);
private
long
oid
;
private
long
ownerId
;
private
String
description
;
...
...
@@ -131,7 +136,6 @@ public abstract class PostgreTableBase extends JDBCTable<PostgreDataSource, Post
/**
* Table columns
* @param monitor progress monitor
* @throws DBException
*/
@Override
public
List
<
PostgreTableColumn
>
getAttributes
(
@NotNull
DBRProgressMonitor
monitor
)
...
...
@@ -209,4 +213,23 @@ public abstract class PostgreTableBase extends JDBCTable<PostgreDataSource, Post
}
public
static
class
TablespaceListProvider
implements
IPropertyValueListProvider
<
PostgreTableBase
>
{
@Override
public
boolean
allowCustomValue
()
{
return
false
;
}
@Override
public
Object
[]
getPossibleValues
(
PostgreTableBase
object
)
{
try
{
Collection
<
PostgreTablespace
>
tablespaces
=
object
.
getDatabase
().
getTablespaces
(
new
VoidProgressMonitor
());
return
tablespaces
.
toArray
(
new
Object
[
tablespaces
.
size
()]);
}
catch
(
DBException
e
)
{
log
.
error
(
e
);
return
new
Object
[
0
];
}
}
}
}
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreViewBase.java
浏览文件 @
cd187d6b
...
...
@@ -109,7 +109,7 @@ public abstract class PostgreViewBase extends PostgreTableReal
if
(
CommonUtils
.
getOption
(
options
,
PostgreConstants
.
OPTION_DDL_SHOW_COLUMN_COMMENTS
)
&&
getDescription
()
!=
null
)
{
actions
.
add
(
new
SQLDatabasePersistAction
(
"Comment"
,
"COMMENT ON
VIEW
"
+
getFullyQualifiedName
(
DBPEvaluationContext
.
DDL
)
+
" IS "
+
SQLUtils
.
quoteString
(
this
,
getDescription
())));
"COMMENT ON
"
+
getViewType
()
+
"
"
+
getFullyQualifiedName
(
DBPEvaluationContext
.
DDL
)
+
" IS "
+
SQLUtils
.
quoteString
(
this
,
getDescription
())));
}
if
(
CommonUtils
.
getOption
(
options
,
PostgreConstants
.
OPTION_DDL_SHOW_PERMISSIONS
))
{
PostgreUtils
.
getObjectGrantPermissionActions
(
monitor
,
this
,
actions
,
options
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录