Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
88b36529
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,发现更多精彩内容 >>
提交
88b36529
编写于
6月 29, 2020
作者:
O
Olav Loite
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: add support for the official Cloud Spanner JDBC driver
Former-commit-id:
366d0629
上级
08dd1703
变更
34
隐藏空白更改
内联
并排
Showing
34 changed file
with
626 addition
and
0 deletion
+626
-0
features/org.jkiss.dbeaver.db.feature/feature.xml
features/org.jkiss.dbeaver.db.feature/feature.xml
+1
-0
features/org.jkiss.dbeaver.db.ui.feature/feature.xml
features/org.jkiss.dbeaver.db.ui.feature/feature.xml
+1
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/META-INF/MANIFEST.MF
...rg.jkiss.dbeaver.ext.cloudspanner.ui/META-INF/MANIFEST.MF
+17
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/OSGI-INF/l10n/bundle.properties
...eaver.ext.cloudspanner.ui/OSGI-INF/l10n/bundle.properties
+4
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/OSGI-INF/l10n/bundle_de.properties
...er.ext.cloudspanner.ui/OSGI-INF/l10n/bundle_de.properties
+1
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/OSGI-INF/l10n/bundle_pt_BR.properties
...ext.cloudspanner.ui/OSGI-INF/l10n/bundle_pt_BR.properties
+4
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/OSGI-INF/l10n/bundle_ru.properties
...er.ext.cloudspanner.ui/OSGI-INF/l10n/bundle_ru.properties
+1
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/build.properties
...ns/org.jkiss.dbeaver.ext.cloudspanner.ui/build.properties
+7
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/icons/spanner_logo.png
....jkiss.dbeaver.ext.cloudspanner.ui/icons/spanner_logo.png
+0
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/plugin.xml
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/plugin.xml
+25
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/pom.xml
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/pom.xml
+14
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/src/org/jkiss/dbeaver/ext/cloudspanner/ui/CloudSpannerActivator.java
...ss/dbeaver/ext/cloudspanner/ui/CloudSpannerActivator.java
+57
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/src/org/jkiss/dbeaver/ext/cloudspanner/ui/internal/CloudSpannerMessages.java
...er/ext/cloudspanner/ui/internal/CloudSpannerMessages.java
+20
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/src/org/jkiss/dbeaver/ext/cloudspanner/ui/internal/messages.properties
.../dbeaver/ext/cloudspanner/ui/internal/messages.properties
+5
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/src/org/jkiss/dbeaver/ext/cloudspanner/ui/internal/messages_de.properties
...eaver/ext/cloudspanner/ui/internal/messages_de.properties
+5
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/src/org/jkiss/dbeaver/ext/cloudspanner/ui/internal/messages_ru.properties
...eaver/ext/cloudspanner/ui/internal/messages_ru.properties
+5
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/src/org/jkiss/dbeaver/ext/cloudspanner/ui/views/CloudSpannerConnectionPage.java
...ext/cloudspanner/ui/views/CloudSpannerConnectionPage.java
+158
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner/META-INF/MANIFEST.MF
...s/org.jkiss.dbeaver.ext.cloudspanner/META-INF/MANIFEST.MF
+13
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner/OSGI-INF/l10n/bundle.properties
....dbeaver.ext.cloudspanner/OSGI-INF/l10n/bundle.properties
+3
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner/build.properties
plugins/org.jkiss.dbeaver.ext.cloudspanner/build.properties
+7
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner/icons/spanner_icon.png
...org.jkiss.dbeaver.ext.cloudspanner/icons/spanner_icon.png
+0
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner/icons/spanner_icon@2x.png
....jkiss.dbeaver.ext.cloudspanner/icons/spanner_icon@2x.png
+0
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner/icons/spanner_icon_big.png
...jkiss.dbeaver.ext.cloudspanner/icons/spanner_icon_big.png
+0
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner/icons/spanner_icon_big@2x.png
...ss.dbeaver.ext.cloudspanner/icons/spanner_icon_big@2x.png
+0
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner/icons/spanner_logo.png
...org.jkiss.dbeaver.ext.cloudspanner/icons/spanner_logo.png
+0
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner/plugin.xml
plugins/org.jkiss.dbeaver.ext.cloudspanner/plugin.xml
+48
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner/pom.xml
plugins/org.jkiss.dbeaver.ext.cloudspanner/pom.xml
+14
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner/src/org/jkiss/dbeaver/ext/cloudspanner/CloudSpannerDataSourceProvider.java
...aver/ext/cloudspanner/CloudSpannerDataSourceProvider.java
+61
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner/src/org/jkiss/dbeaver/ext/cloudspanner/model/CloudSpannerConstants.java
...dbeaver/ext/cloudspanner/model/CloudSpannerConstants.java
+26
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner/src/org/jkiss/dbeaver/ext/cloudspanner/model/CloudSpannerDataSource.java
...beaver/ext/cloudspanner/model/CloudSpannerDataSource.java
+56
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner/src/org/jkiss/dbeaver/ext/cloudspanner/model/CloudSpannerMetaModel.java
...dbeaver/ext/cloudspanner/model/CloudSpannerMetaModel.java
+41
-0
plugins/org.jkiss.dbeaver.ext.cloudspanner/src/org/jkiss/dbeaver/ext/cloudspanner/model/CloudSpannerSQLDialect.java
...beaver/ext/cloudspanner/model/CloudSpannerSQLDialect.java
+28
-0
plugins/pom.xml
plugins/pom.xml
+2
-0
product/debug/DBeaver.product.launch
product/debug/DBeaver.product.launch
+2
-0
未找到文件。
features/org.jkiss.dbeaver.db.feature/feature.xml
浏览文件 @
88b36529
...
...
@@ -28,6 +28,7 @@
<plugin
id=
"org.jkiss.dbeaver.ext.athena"
download-size=
"0"
install-size=
"0"
version=
"0.0.0"
unpack=
"false"
/>
<plugin
id=
"org.jkiss.dbeaver.ext.bigquery"
download-size=
"0"
install-size=
"0"
version=
"0.0.0"
unpack=
"false"
/>
<plugin
id=
"org.jkiss.dbeaver.ext.clickhouse"
download-size=
"0"
install-size=
"0"
version=
"0.0.0"
unpack=
"false"
/>
<plugin
id=
"org.jkiss.dbeaver.ext.cloudspanner"
download-size=
"0"
install-size=
"0"
version=
"0.0.0"
unpack=
"false"
/>
<plugin
id=
"org.jkiss.dbeaver.ext.db2.zos"
download-size=
"0"
install-size=
"0"
version=
"0.0.0"
unpack=
"false"
/>
<plugin
id=
"org.jkiss.dbeaver.ext.db2.i"
download-size=
"0"
install-size=
"0"
version=
"0.0.0"
unpack=
"false"
/>
<plugin
id=
"org.jkiss.dbeaver.ext.derby"
download-size=
"0"
install-size=
"0"
version=
"0.0.0"
unpack=
"false"
/>
...
...
features/org.jkiss.dbeaver.db.ui.feature/feature.xml
浏览文件 @
88b36529
...
...
@@ -30,6 +30,7 @@
<plugin
id=
"org.jkiss.dbeaver.ext.athena.ui"
download-size=
"0"
install-size=
"0"
version=
"0.0.0"
unpack=
"false"
/>
<plugin
id=
"org.jkiss.dbeaver.ext.bigquery.ui"
download-size=
"0"
install-size=
"0"
version=
"0.0.0"
unpack=
"false"
/>
<plugin
id=
"org.jkiss.dbeaver.ext.cloudspanner.ui"
download-size=
"0"
install-size=
"0"
version=
"0.0.0"
unpack=
"false"
/>
<plugin
id=
"org.jkiss.dbeaver.ext.spanner.ui"
download-size=
"0"
install-size=
"0"
version=
"0.0.0"
unpack=
"false"
/>
<plugin
id=
"org.jkiss.dbeaver.ext.snowflake.ui"
download-size=
"0"
install-size=
"0"
version=
"0.0.0"
unpack=
"false"
/>
<plugin
id=
"org.jkiss.dbeaver.ext.sqlite.ui"
download-size=
"0"
install-size=
"0"
version=
"0.0.0"
unpack=
"false"
/>
...
...
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/META-INF/MANIFEST.MF
0 → 100644
浏览文件 @
88b36529
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.jkiss.dbeaver.ext.cloudspanner.ui;singleton:=true
Bundle-Version: 1.0.5.qualifier
Bundle-Release-Date: 20200622
Bundle-Activator: org.jkiss.dbeaver.ext.cloudspanner.ui.CloudSpannerActivator
Require-Bundle: org.eclipse.ui,
org.jkiss.dbeaver.ui.editors.connection,
org.jkiss.dbeaver.model,
org.jkiss.dbeaver.ui,
org.jkiss.dbeaver.ext.cloudspanner
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Vendor: %Bundle-Vendor
Bundle-Localization: OSGI-INF/l10n/bundle
Automatic-Module-Name: org.jkiss.dbeaver.ext.cloudspanner.ui
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/OSGI-INF/l10n/bundle.properties
0 → 100644
浏览文件 @
88b36529
Bundle-Vendor
=
DBeaver Corp
Bundle-Name
=
DBeaver Google Spanner UI
spanner.dialog.connection.header
=
Google Spanner Connection Settings
\ No newline at end of file
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/OSGI-INF/l10n/bundle_de.properties
0 → 100644
浏览文件 @
88b36529
spanner.dialog.connection.header
=
Google Spanner Verbindungseinstellungen
\ No newline at end of file
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/OSGI-INF/l10n/bundle_pt_BR.properties
0 → 100644
浏览文件 @
88b36529
Bundle-Name
=
DBeaver Google UI
Bundle-Vendor
=
DBeaver Corp
spanner.dialog.connection.header
=
Google Spanner Configura
\u
00E7
\u
00F5es de conex
\u
00E3o
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/OSGI-INF/l10n/bundle_ru.properties
0 → 100644
浏览文件 @
88b36529
spanner.dialog.connection.header
=
\u
041D
\u0430\u0441\u0442\u0440\u
043E
\u0439\u
043A
\u0438
\u
043F
\u
043E
\u0434\u
043A
\u
043B
\u
044E
\u0447\u0435\u
043D
\u0438\u
044F Google Spanner
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/build.properties
0 → 100644
浏览文件 @
88b36529
source..
=
src/
output..
=
target/classes/
bin.includes
=
plugin.xml,
\
META-INF/,
\
.,
\
OSGI-INF/,
\
icons/,
\
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/icons/spanner_logo.png
0 → 100644
浏览文件 @
88b36529
8.8 KB
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/plugin.xml
0 → 100644
浏览文件 @
88b36529
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
<extension
point=
"org.jkiss.dbeaver.dataSourceView"
>
<view
id=
"org.jkiss.dbeaver.ext.cloudspanner.dataSourceWizardView"
targetID=
"org.jkiss.dbeaver.ext.ui.newConnectionWizard"
dataSource=
"google_cloudspanner"
label=
"%spanner.dialog.connection.header"
class=
"org.jkiss.dbeaver.ext.cloudspanner.ui.views.CloudSpannerConnectionPage"
icon=
"platform:/plugin/org.jkiss.dbeaver.ext.cloudspanner/icons/spanner_icon.png"
>
</view>
<view
class=
"org.jkiss.dbeaver.ext.cloudspanner.ui.views.CloudSpannerConnectionPage"
icon=
"platform:/plugin/org.jkiss.dbeaver.ext.cloudspanner/icons/spanner_icon.png"
id=
"org.jkiss.dbeaver.ext.cloudspanner.dataSourceEditorView"
dataSource=
"google_cloudspanner"
label=
"%spanner.dialog.connection.header"
targetID=
"org.jkiss.dbeaver.ext.ui.editConnectionDialog"
>
</view>
</extension>
</plugin>
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/pom.xml
0 → 100644
浏览文件 @
88b36529
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
org.jkiss.dbeaver
</groupId>
<artifactId>
plugins
</artifactId>
<version>
1.0.0-SNAPSHOT
</version>
<relativePath>
../
</relativePath>
</parent>
<artifactId>
org.jkiss.dbeaver.ext.cloudspanner.ui
</artifactId>
<version>
1.0.5-SNAPSHOT
</version>
<packaging>
eclipse-plugin
</packaging>
</project>
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/src/org/jkiss/dbeaver/ext/cloudspanner/ui/CloudSpannerActivator.java
0 → 100644
浏览文件 @
88b36529
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2020 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.jkiss.dbeaver.ext.cloudspanner.ui
;
import
org.eclipse.jface.resource.ImageDescriptor
;
import
org.eclipse.ui.plugin.AbstractUIPlugin
;
import
org.osgi.framework.BundleContext
;
/**
* The activator class controls the plug-in life cycle
*/
public
class
CloudSpannerActivator
extends
AbstractUIPlugin
{
// The plug-in ID
public
static
final
String
PLUGIN_ID
=
"org.jkiss.dbeaver.ext.cloudspanner.ui"
;
// The shared instance
private
static
CloudSpannerActivator
plugin
;
public
CloudSpannerActivator
()
{
}
@Override
public
void
start
(
BundleContext
context
)
throws
Exception
{
super
.
start
(
context
);
plugin
=
this
;
}
@Override
public
void
stop
(
BundleContext
context
)
throws
Exception
{
plugin
=
null
;
super
.
stop
(
context
);
}
public
static
CloudSpannerActivator
getDefault
()
{
return
plugin
;
}
public
static
ImageDescriptor
getImageDescriptor
(
String
path
)
{
return
imageDescriptorFromPlugin
(
PLUGIN_ID
,
path
);
}
}
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/src/org/jkiss/dbeaver/ext/cloudspanner/ui/internal/CloudSpannerMessages.java
0 → 100644
浏览文件 @
88b36529
package
org.jkiss.dbeaver.ext.cloudspanner.ui.internal
;
import
org.eclipse.osgi.util.NLS
;
public
class
CloudSpannerMessages
extends
NLS
{
private
static
final
String
BUNDLE_NAME
=
"org.jkiss.dbeaver.ext.cloudspanner.ui.internal.messages"
;
//$NON-NLS-1$
public
static
String
label_connection
;
public
static
String
label_private_key_path
;
public
static
String
label_project
;
public
static
String
label_instance
;
public
static
String
label_database
;
static
{
// initialize resource bundle
NLS
.
initializeMessages
(
BUNDLE_NAME
,
CloudSpannerMessages
.
class
);
}
private
CloudSpannerMessages
()
{
}
}
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/src/org/jkiss/dbeaver/ext/cloudspanner/ui/internal/messages.properties
0 → 100644
浏览文件 @
88b36529
label_connection
=
Connection
label_private_key_path
=
Private key path (p12 or JSON)
label_project
=
Project
label_instance
=
Instance
label_database
=
Database
\ No newline at end of file
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/src/org/jkiss/dbeaver/ext/cloudspanner/ui/internal/messages_de.properties
0 → 100644
浏览文件 @
88b36529
label_connection
=
Verbindung
label_private_key_path
=
Privater Schl
\u
00fcsselpfad (p12 oder JSON)
label_project
=
Projekt
label_instance
=
Instanz
label_database
=
Datenbank
\ No newline at end of file
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/src/org/jkiss/dbeaver/ext/cloudspanner/ui/internal/messages_ru.properties
0 → 100644
浏览文件 @
88b36529
label_connection
=
\u0421\u
043E
\u0435\u0434\u0438\u
043D
\u0435\u
043D
\u0438\u0435
label_private_key_path
=
\u
041F
\u0443\u0442\u
044C
\u
043A
\u0437\u0430\u
043A
\u0440\u
044B
\u0442\u
043E
\u
043C
\u0443
\u
043A
\u
043B
\u
044E
\u0447\u0443
(p12
\u0438\u
043B
\u0438
JSON)
label_project
=
\u
041F
\u0440\u
043E
\u0435\u
043A
\u0442
label_instance
=
\u
042D
\u
043A
\u0437\u0435\u
043C
\u
043F
\u
043B
\u
044F
\u0440
label_database
=
\u0411\u0430\u0437\u0430
\u0434\u0430\u
043D
\u
043D
\u
044B
\u0445
\ No newline at end of file
plugins/org.jkiss.dbeaver.ext.cloudspanner.ui/src/org/jkiss/dbeaver/ext/cloudspanner/ui/views/CloudSpannerConnectionPage.java
0 → 100644
浏览文件 @
88b36529
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2020 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.jkiss.dbeaver.ext.cloudspanner.ui.views
;
import
org.eclipse.jface.dialogs.IDialogPage
;
import
org.eclipse.jface.resource.ImageDescriptor
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.events.ModifyListener
;
import
org.eclipse.swt.layout.GridData
;
import
org.eclipse.swt.layout.GridLayout
;
import
org.eclipse.swt.widgets.Composite
;
import
org.eclipse.swt.widgets.Text
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.ext.cloudspanner.ui.CloudSpannerActivator
;
import
org.jkiss.dbeaver.ext.cloudspanner.ui.internal.CloudSpannerMessages
;
import
org.jkiss.dbeaver.ext.cloudspanner.model.CloudSpannerConstants
;
import
org.jkiss.dbeaver.model.DBPDataSourceContainer
;
import
org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration
;
import
org.jkiss.dbeaver.ui.ICompositeDialogPage
;
import
org.jkiss.dbeaver.ui.UIUtils
;
import
org.jkiss.dbeaver.ui.controls.TextWithOpenFile
;
import
org.jkiss.dbeaver.ui.dialogs.connection.ConnectionPageAbstract
;
import
org.jkiss.dbeaver.ui.dialogs.connection.DriverPropertiesDialogPage
;
import
org.jkiss.utils.CommonUtils
;
/**
* CloudSpannerConnectionPage
*/
public
class
CloudSpannerConnectionPage
extends
ConnectionPageAbstract
implements
ICompositeDialogPage
{
private
static
final
Log
log
=
Log
.
getLog
(
CloudSpannerConnectionPage
.
class
);
private
Text
projectText
;
private
Text
instanceText
;
private
Text
databaseText
;
private
TextWithOpenFile
privateKeyFile
;
private
static
ImageDescriptor
logoImage
=
CloudSpannerActivator
.
getImageDescriptor
(
"icons/spanner_logo.png"
);
//$NON-NLS-1$
private
DriverPropertiesDialogPage
driverPropsPage
;
public
CloudSpannerConnectionPage
()
{
driverPropsPage
=
new
DriverPropertiesDialogPage
(
this
);
}
@Override
public
void
dispose
()
{
super
.
dispose
();
}
@Override
public
void
createControl
(
Composite
composite
)
{
setImageDescriptor
(
logoImage
);
Composite
settingsGroup
=
new
Composite
(
composite
,
SWT
.
NONE
);
settingsGroup
.
setLayout
(
new
GridLayout
(
1
,
false
));
settingsGroup
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_BOTH
));
ModifyListener
textListener
=
e
->
site
.
updateButtons
();
{
Composite
addrGroup
=
UIUtils
.
createControlGroup
(
settingsGroup
,
CloudSpannerMessages
.
label_connection
,
2
,
0
,
0
);
addrGroup
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_HORIZONTAL
));
projectText
=
UIUtils
.
createLabelText
(
addrGroup
,
CloudSpannerMessages
.
label_project
,
""
);
//$NON-NLS-2$
projectText
.
setToolTipText
(
"Cloud Spanner Project ID"
);
//$NON-NLS-1$
projectText
.
addModifyListener
(
textListener
);
instanceText
=
UIUtils
.
createLabelText
(
addrGroup
,
CloudSpannerMessages
.
label_instance
,
""
);
//$NON-NLS-2$
instanceText
.
setToolTipText
(
"Cloud Spanner Instance ID"
);
//$NON-NLS-1$
instanceText
.
addModifyListener
(
textListener
);
databaseText
=
UIUtils
.
createLabelText
(
addrGroup
,
CloudSpannerMessages
.
label_database
,
""
);
//$NON-NLS-2$
databaseText
.
setToolTipText
(
"Cloud Spanner Database ID"
);
//$NON-NLS-1$
databaseText
.
addModifyListener
(
textListener
);
UIUtils
.
createControlLabel
(
addrGroup
,
CloudSpannerMessages
.
label_private_key_path
);
privateKeyFile
=
new
TextWithOpenFile
(
addrGroup
,
CloudSpannerMessages
.
label_private_key_path
,
new
String
[]
{
"*"
,
"*.json"
}
);
//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
GridData
gd
=
new
GridData
(
GridData
.
HORIZONTAL_ALIGN_BEGINNING
|
GridData
.
FILL_HORIZONTAL
);
//gd.horizontalSpan = 3;
privateKeyFile
.
setLayoutData
(
gd
);
}
createDriverPanel
(
settingsGroup
);
setControl
(
settingsGroup
);
}
@Override
public
boolean
isComplete
()
{
return
projectText
!=
null
&&
!
CommonUtils
.
isEmpty
(
projectText
.
getText
())
&&
instanceText
!=
null
&&
!
CommonUtils
.
isEmpty
(
instanceText
.
getText
())
&&
databaseText
!=
null
&&
!
CommonUtils
.
isEmpty
(
databaseText
.
getText
());
}
@Override
public
void
loadSettings
()
{
super
.
loadSettings
();
// Load values from new connection info
DBPConnectionConfiguration
connectionInfo
=
site
.
getActiveDataSource
().
getConnectionConfiguration
();
if
(
projectText
!=
null
)
{
projectText
.
setText
(
CommonUtils
.
notEmpty
(
connectionInfo
.
getServerName
()));
}
if
(
instanceText
!=
null
)
{
instanceText
.
setText
(
CommonUtils
.
notEmpty
(
connectionInfo
.
getHostName
()));
}
if
(
databaseText
!=
null
)
{
databaseText
.
setText
(
CommonUtils
.
notEmpty
(
connectionInfo
.
getDatabaseName
()));
}
if
(
privateKeyFile
!=
null
)
{
privateKeyFile
.
setText
(
CommonUtils
.
notEmpty
(
connectionInfo
.
getProviderProperty
(
CloudSpannerConstants
.
DRIVER_PROP_CREDENTIALS_FILE
)));
}
}
@Override
public
void
saveSettings
(
DBPDataSourceContainer
dataSource
)
{
DBPConnectionConfiguration
connectionInfo
=
dataSource
.
getConnectionConfiguration
();
if
(
projectText
!=
null
)
{
connectionInfo
.
setServerName
(
projectText
.
getText
().
trim
());
}
if
(
instanceText
!=
null
)
{
connectionInfo
.
setHostName
(
instanceText
.
getText
().
trim
());
}
if
(
databaseText
!=
null
)
{
connectionInfo
.
setDatabaseName
(
databaseText
.
getText
().
trim
());
}
if
(
privateKeyFile
!=
null
)
{
connectionInfo
.
setProviderProperty
(
CloudSpannerConstants
.
DRIVER_PROP_CREDENTIALS_FILE
,
privateKeyFile
.
getText
());
}
super
.
saveSettings
(
dataSource
);
}
@Override
public
IDialogPage
[]
getSubPages
(
boolean
extrasOnly
,
boolean
forceCreate
)
{
return
new
IDialogPage
[]
{
driverPropsPage
};
}
}
plugins/org.jkiss.dbeaver.ext.cloudspanner/META-INF/MANIFEST.MF
0 → 100644
浏览文件 @
88b36529
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: DBeaver Cloud Spanner extension
Bundle-SymbolicName: org.jkiss.dbeaver.ext.cloudspanner;singleton:=true
Bundle-Version: 1.0.22.qualifier
Bundle-Release-Date: 20200622
Require-Bundle: org.jkiss.dbeaver.ext.generic
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Vendor: DBeaver Corp
Bundle-Localization: OSGI-INF/l10n/bundle
Automatic-Module-Name: org.jkiss.dbeaver.ext.cloudspanner
Export-Package: org.jkiss.dbeaver.ext.cloudspanner.model
plugins/org.jkiss.dbeaver.ext.cloudspanner/OSGI-INF/l10n/bundle.properties
0 → 100644
浏览文件 @
88b36529
Bundle-Vendor
=
DBeaver Corp
Bundle-Name
=
DBeaver Google Cloud Spanner Extension
datasource.cloudspanner.description
=
Google Cloud Spanner Datasource
\ No newline at end of file
plugins/org.jkiss.dbeaver.ext.cloudspanner/build.properties
0 → 100644
浏览文件 @
88b36529
source..
=
src/
output..
=
target/classes/
bin.includes
=
plugin.xml,
\
META-INF/,
\
OSGI-INF/,
\
.,
\
icons/
plugins/org.jkiss.dbeaver.ext.cloudspanner/icons/spanner_icon.png
0 → 100644
浏览文件 @
88b36529
874 字节
plugins/org.jkiss.dbeaver.ext.cloudspanner/icons/spanner_icon@2x.png
0 → 100644
浏览文件 @
88b36529
2.2 KB
plugins/org.jkiss.dbeaver.ext.cloudspanner/icons/spanner_icon_big.png
0 → 100644
浏览文件 @
88b36529
4.9 KB
plugins/org.jkiss.dbeaver.ext.cloudspanner/icons/spanner_icon_big@2x.png
0 → 100644
浏览文件 @
88b36529
8.7 KB
plugins/org.jkiss.dbeaver.ext.cloudspanner/icons/spanner_logo.png
0 → 100644
浏览文件 @
88b36529
8.8 KB
plugins/org.jkiss.dbeaver.ext.cloudspanner/plugin.xml
0 → 100644
浏览文件 @
88b36529
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
<extension
point=
"org.jkiss.dbeaver.dataSourceProvider"
>
<!-- Spanner -->
<datasource
class=
"org.jkiss.dbeaver.ext.cloudspanner.CloudSpannerDataSourceProvider"
description=
"%datasource.cloudspanner.description"
id=
"google_cloudspanner"
parent=
"generic"
label=
"Google Cloud Spanner"
icon=
"icons/spanner_icon.png"
dialect=
"cloudspanner"
>
<drivers
managable=
"true"
>
<driver
id=
"cloudspanner_jdbc"
label=
"Google Cloud Spanner"
icon=
"icons/spanner_icon.png"
iconBig=
"icons/spanner_icon_big.png"
class=
"com.google.cloud.spanner.jdbc.JdbcDriver"
sampleURL=
"jdbc:cloudspanner:/projects/my-project/instances/my-instance/databases/my-database"
defaultPort=
""
description=
"Google Cloud Spanner Open Source JDBC Driver"
webURL=
"https://cloud.google.com/spanner/docs/use-oss-jdbc"
categories=
"bigdata,cloud"
>
<parameter
name=
"omit-catalog"
value=
"true"
/>
<parameter
name=
"omit-schema"
value=
"false"
/>
<file
type=
"jar"
path=
"maven:/com.google.cloud:google-cloud-spanner-jdbc:RELEASE"
/>
</driver>
</drivers>
</datasource>
</extension>
<extension
point=
"org.jkiss.dbeaver.sqlDialect"
>
<dialect
id=
"cloudspanner"
parent=
"generic"
class=
"org.jkiss.dbeaver.ext.cloudspanner.model.CloudSpannerSQLDialect"
label=
"Cloud Spanner"
description=
"Google Spanner SQL dialect."
icon=
"icons/spanner_icon.png"
>
</dialect>
</extension>
</plugin>
plugins/org.jkiss.dbeaver.ext.cloudspanner/pom.xml
0 → 100644
浏览文件 @
88b36529
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
org.jkiss.dbeaver
</groupId>
<artifactId>
plugins
</artifactId>
<version>
1.0.0-SNAPSHOT
</version>
<relativePath>
../
</relativePath>
</parent>
<artifactId>
org.jkiss.dbeaver.ext.cloudspanner
</artifactId>
<version>
1.0.22-SNAPSHOT
</version>
<packaging>
eclipse-plugin
</packaging>
</project>
plugins/org.jkiss.dbeaver.ext.cloudspanner/src/org/jkiss/dbeaver/ext/cloudspanner/CloudSpannerDataSourceProvider.java
0 → 100644
浏览文件 @
88b36529
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2020 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.jkiss.dbeaver.ext.cloudspanner
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.ext.generic.GenericDataSourceProvider
;
import
org.jkiss.dbeaver.ext.cloudspanner.model.CloudSpannerDataSource
;
import
org.jkiss.dbeaver.ext.cloudspanner.model.CloudSpannerMetaModel
;
import
org.jkiss.dbeaver.model.DBPDataSource
;
import
org.jkiss.dbeaver.model.DBPDataSourceContainer
;
import
org.jkiss.dbeaver.model.app.DBPPlatform
;
import
org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration
;
import
org.jkiss.dbeaver.model.connection.DBPDriver
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
public
class
CloudSpannerDataSourceProvider
extends
GenericDataSourceProvider
{
private
static
final
Log
log
=
Log
.
getLog
(
CloudSpannerDataSourceProvider
.
class
);
public
CloudSpannerDataSourceProvider
()
{
}
@Override
public
void
init
(
@NotNull
DBPPlatform
platform
)
{
}
@NotNull
@Override
public
DBPDataSource
openDataSource
(
@NotNull
DBRProgressMonitor
monitor
,
@NotNull
DBPDataSourceContainer
container
)
throws
DBException
{
return
new
CloudSpannerDataSource
(
monitor
,
container
,
new
CloudSpannerMetaModel
());
}
@Override
public
String
getConnectionURL
(
DBPDriver
driver
,
DBPConnectionConfiguration
connectionInfo
)
{
StringBuilder
url
=
new
StringBuilder
();
url
.
append
(
"jdbc:cloudspanner:"
);
return
url
.
toString
();
}
}
plugins/org.jkiss.dbeaver.ext.cloudspanner/src/org/jkiss/dbeaver/ext/cloudspanner/model/CloudSpannerConstants.java
0 → 100644
浏览文件 @
88b36529
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2020 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.jkiss.dbeaver.ext.cloudspanner.model
;
/**
* Cloud Spanner constants
*/
public
class
CloudSpannerConstants
{
public
static
final
String
DRIVER_PROP_CREDENTIALS_FILE
=
"credentials"
;
}
plugins/org.jkiss.dbeaver.ext.cloudspanner/src/org/jkiss/dbeaver/ext/cloudspanner/model/CloudSpannerDataSource.java
0 → 100644
浏览文件 @
88b36529
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2020 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.jkiss.dbeaver.ext.cloudspanner.model
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.ext.generic.model.GenericDataSource
;
import
org.jkiss.dbeaver.model.DBPDataSourceContainer
;
import
org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration
;
import
org.jkiss.dbeaver.model.connection.DBPDriver
;
import
org.jkiss.dbeaver.model.exec.DBCException
;
import
org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
CloudSpannerDataSource
extends
GenericDataSource
{
public
CloudSpannerDataSource
(
DBRProgressMonitor
monitor
,
DBPDataSourceContainer
container
,
CloudSpannerMetaModel
metaModel
)
throws
DBException
{
super
(
monitor
,
container
,
metaModel
,
new
CloudSpannerSQLDialect
());
}
@Override
protected
String
getConnectionURL
(
DBPConnectionConfiguration
connectionInfo
)
{
StringBuilder
url
=
new
StringBuilder
(
super
.
getConnectionURL
(
connectionInfo
));
url
.
append
(
"/projects/"
).
append
(
connectionInfo
.
getServerName
());
url
.
append
(
"/instances/"
).
append
(
connectionInfo
.
getHostName
());
url
.
append
(
"/databases/"
).
append
(
connectionInfo
.
getDatabaseName
());
return
url
.
toString
();
}
@Override
protected
Map
<
String
,
String
>
getInternalConnectionProperties
(
DBRProgressMonitor
monitor
,
DBPDriver
driver
,
JDBCExecutionContext
context
,
String
purpose
,
DBPConnectionConfiguration
connectionInfo
)
throws
DBCException
{
Map
<
String
,
String
>
props
=
new
HashMap
<>();
props
.
put
(
CloudSpannerConstants
.
DRIVER_PROP_CREDENTIALS_FILE
,
connectionInfo
.
getProviderProperty
(
CloudSpannerConstants
.
DRIVER_PROP_CREDENTIALS_FILE
));
return
props
;
}
}
plugins/org.jkiss.dbeaver.ext.cloudspanner/src/org/jkiss/dbeaver/ext/cloudspanner/model/CloudSpannerMetaModel.java
0 → 100644
浏览文件 @
88b36529
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2020 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.jkiss.dbeaver.ext.cloudspanner.model
;
import
org.jkiss.dbeaver.ext.generic.model.meta.GenericMetaModel
;
import
java.util.regex.Pattern
;
/**
* Spanner meta model
*/
public
class
CloudSpannerMetaModel
extends
GenericMetaModel
{
private
Pattern
ERROR_POSITION_PATTERN
=
Pattern
.
compile
(
" at \\[([0-9]+)\\:([0-9]+)\\]"
);
public
CloudSpannerMetaModel
()
{
}
// The default schema in Cloud Spanner is an empty string. This ensures that this
// default schema will be shown as 'DEFAULT' in DBeaver, and enables auto complete
// for tables and views in both the DEFAULT schema, as well as the INFORMATION_SCHEMA
// and SPANNER_SYS schemas.
public
boolean
supportsNullSchemas
()
{
return
true
;
}
}
plugins/org.jkiss.dbeaver.ext.cloudspanner/src/org/jkiss/dbeaver/ext/cloudspanner/model/CloudSpannerSQLDialect.java
0 → 100644
浏览文件 @
88b36529
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2020 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.jkiss.dbeaver.ext.cloudspanner.model
;
import
org.jkiss.dbeaver.ext.generic.model.GenericSQLDialect
;
/**
* Cloud Spanner dialect.
*/
public
class
CloudSpannerSQLDialect
extends
GenericSQLDialect
{
public
CloudSpannerSQLDialect
()
{
super
(
"Cloud Spanner"
);
}
}
plugins/pom.xml
浏览文件 @
88b36529
...
...
@@ -24,6 +24,7 @@
<module>
org.jkiss.dbeaver.ext.athena
</module>
<module>
org.jkiss.dbeaver.ext.bigquery
</module>
<module>
org.jkiss.dbeaver.ext.clickhouse
</module>
<module>
org.jkiss.dbeaver.ext.cloudspanner
</module>
<module>
org.jkiss.dbeaver.ext.db2
</module>
<module>
org.jkiss.dbeaver.ext.db2.zos
</module>
<module>
org.jkiss.dbeaver.ext.db2.i
</module>
...
...
@@ -79,6 +80,7 @@
<module>
org.jkiss.dbeaver.ext.athena.ui
</module>
<module>
org.jkiss.dbeaver.ext.bigquery.ui
</module>
<module>
org.jkiss.dbeaver.ext.cloudspanner.ui
</module>
<module>
org.jkiss.dbeaver.ext.exasol.ui
</module>
<module>
org.jkiss.dbeaver.ext.db2.ui
</module>
...
...
product/debug/DBeaver.product.launch
浏览文件 @
88b36529
...
...
@@ -230,6 +230,8 @@
<setEntry
value=
"org.jkiss.dbeaver.ext.bigquery.ui@default:default"
/>
<setEntry
value=
"org.jkiss.dbeaver.ext.bigquery@default:default"
/>
<setEntry
value=
"org.jkiss.dbeaver.ext.clickhouse@default:default"
/>
<setEntry
value=
"org.jkiss.dbeaver.ext.cloudspanner.ui@default:default"
/>
<setEntry
value=
"org.jkiss.dbeaver.ext.cloudspanner@default:default"
/>
<setEntry
value=
"org.jkiss.dbeaver.ext.db2.i@default:default"
/>
<setEntry
value=
"org.jkiss.dbeaver.ext.db2.ui@default:default"
/>
<setEntry
value=
"org.jkiss.dbeaver.ext.db2.zos@default:default"
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录