提交 be24c130 编写于 作者: S Serge Rider

#5930 Google Spanner extension

上级 52a6790d
......@@ -30,6 +30,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.spanner" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.jkiss.dbeaver.ext.es.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" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
......
......@@ -12,21 +12,20 @@
description="%datasource.bq.description"
id="bigquery"
parent="generic"
label="BigQuery"
label="Google BigQuery"
icon="icons/bigquery_icon.png">
<drivers managable="true">
<!-- Simba JDBC driver -->
<driver
id="google_bigquery_jdbc_simba"
label="BigQuery"
label="Google BigQuery"
icon="icons/bigquery_icon.png"
iconBig="icons/bigquery_icon_big.png"
class="com.simba.googlebigquery.jdbc42.Driver"
sampleURL="jdbc:bigquery://{host}:{port};ProjectId={database};OAuthType=0;OAuthServiceAcctEmail={user};OAuthPvtKeyPath={server};"
defaultPort="443"
description="Google BigQuery driver"
category="Google"
webURL="https://cloud.google.com/bigquery/partners/simba-drivers/"
propertiesURL="http://cdn.simba.com/products/BigQuery/doc/JDBC_InstallGuide/"
categories="bigdata">
......@@ -41,7 +40,7 @@
<extension point="org.jkiss.dbeaver.dataSourceView">
<view
id="org.jkiss.dbeaver.ext.snowflake.dataSourceWizardView"
id="org.jkiss.dbeaver.ext.bigquery.dataSourceWizardView"
targetID="org.jkiss.dbeaver.ext.ui.newConnectionWizard"
dataSource="bigquery"
label="%bigquery.dialog.connection.header"
......@@ -51,7 +50,7 @@
<view
class="org.jkiss.dbeaver.ext.bigquery.views.BigQueryConnectionPage"
icon="icons/google_bigquery_icon.png"
id="org.jkiss.dbeaver.ext.snowflake.dataSourceEditorView"
id="org.jkiss.dbeaver.ext.bigquery.dataSourceEditorView"
dataSource="bigquery"
label="%bigquery.dialog.connection.header"
targetID="org.jkiss.dbeaver.ext.ui.editConnectionDialog">
......
......@@ -1069,21 +1069,6 @@
<file type="jar" path="https://github.com/KxSystems/kdb/raw/master/c/jdbc.jar"/>
</driver>
<driver
id="google_spanner"
label="Spanner"
category="Google"
class="com.simba.cloudspanner.core.jdbc42.CloudSpanner42Driver"
sampleURL="jdbc:cloudspanner://{host};Project={database}"
defaultPort=""
description="Google Spanner JDBC driver by Simba"
webURL="https://cloud.google.com/spanner/docs/partners/drivers"
categories="bigdata,cloud">
<file type="jar" path="https://storage.cloud.google.com/simba-cs-release/jdbc/CloudSpannerJDBC42-1.0.11.1023.zip"/>
<parameter name="omit-catalog" value="true"/>
<parameter name="omit-schema" value="true"/>
</driver>
<!-- Legacy deprecated drivers -->
<driver
......
......@@ -94,8 +94,15 @@ public class TableCache extends JDBCStructLookupCache<GenericStructContainer, Ge
String tableName = GenericUtils.safeGetStringTrimmed(tableObject, dbResult, JDBCConstants.TABLE_NAME);
String tableType = GenericUtils.safeGetStringTrimmed(tableObject, dbResult, JDBCConstants.TABLE_TYPE);
String tableSchema = GenericUtils.safeGetStringTrimmed(tableObject, dbResult, JDBCConstants.TABLE_SCHEM);
if (!CommonUtils.isEmpty(tableSchema) && owner.getDataSource().isOmitSchema()) {
// Ignore tables with schema [Google Spanner]
log.debug("Ignore table " + tableSchema + "." + tableName + " (schemas are omitted)");
return null;
}
if (CommonUtils.isEmpty(tableName)) {
log.debug("Empty table name" + (owner == null ? "" : " in container " + owner.getName()));
log.debug("Empty table name " + (owner == null ? "" : " in container " + owner.getName()));
return null;
}
......
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: DBeaver Spanner extension
Bundle-SymbolicName: org.jkiss.dbeaver.ext.spanner;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Release-Date: 20190722
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.jkiss.dbeaver.core,
org.jkiss.dbeaver.model,
org.jkiss.dbeaver.ext.generic
Bundle-Activator: org.jkiss.dbeaver.ext.spanner.SpannerActivator
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Vendor: DBeaver Corp
Bundle-Localization: OSGI-INF/l10n/bundle
Bundle-Vendor = DBeaver Corp
Bundle-Name = DBeaver Google Spanner Extension
datasource.spanner.description = Spanner datasource
spanner.dialog.connection.header=Google Spanner Connection Settings
spanner.dialog.connection.header=\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F Google Spanner
source.. = src/
output.. = target/classes/
bin.includes = plugin.xml,\
META-INF/,\
OSGI-INF/,\
.,\
icons/
<?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.spanner.SpannerDataSourceProvider"
description="%datasource.spanner.description"
id="google_spanner"
parent="generic"
label="Google Spanner"
icon="icons/spanner_icon.png">
<drivers managable="true">
<driver
id="spanner_jdbc"
label="Google Spanner"
icon="icons/spanner_icon.png"
iconBig="icons/spanner_icon_big.png"
class="nl.topicus.jdbc.CloudSpannerDriver"
sampleURL="jdbc:cloudspanner://localhost"
defaultPort=""
description="Google Spanner JDBC driver by Simba"
webURL="https://github.com/olavloite/spanner-jdbc"
categories="bigdata,cloud">
<!--<file type="jar" path="https://storage.cloud.google.com/simba-cs-release/jdbc/CloudSpannerJDBC42-1.0.11.1023.zip"/>-->
<parameter name="omit-catalog" value="true"/>
<parameter name="omit-schema" value="true"/>
<file type="jar" path="maven:/nl.topicus:spanner-jdbc:RELEASE"/>
</driver>
</drivers>
</datasource>
</extension>
<extension point="org.jkiss.dbeaver.dataSourceView">
<view
id="org.jkiss.dbeaver.ext.spanner.dataSourceWizardView"
targetID="org.jkiss.dbeaver.ext.ui.newConnectionWizard"
dataSource="google_spanner"
label="%spanner.dialog.connection.header"
class="org.jkiss.dbeaver.ext.spanner.views.SpannerConnectionPage"
icon="icons/spanner_icon.png">
</view>
<view
class="org.jkiss.dbeaver.ext.spanner.views.SpannerConnectionPage"
icon="icons/spanner_icon.png"
id="org.jkiss.dbeaver.ext.spanner.dataSourceEditorView"
dataSource="google_spanner"
label="%spanner.dialog.connection.header"
targetID="org.jkiss.dbeaver.ext.ui.editConnectionDialog">
</view>
</extension>
</plugin>
<?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.spanner</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* 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.spanner;
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 SpannerActivator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "org.jkiss.dbeaver.ext.spanner";
// The shared instance
private static SpannerActivator plugin;
public SpannerActivator() {
}
@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 SpannerActivator getDefault() {
return plugin;
}
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
}
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* 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.spanner;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.ext.spanner.model.SpannerDataSource;
import org.jkiss.dbeaver.ext.spanner.model.SpannerMetaModel;
import org.jkiss.dbeaver.ext.generic.GenericDataSourceProvider;
import org.jkiss.dbeaver.ext.generic.model.meta.GenericMetaModel;
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;
import org.jkiss.utils.CommonUtils;
public class SpannerDataSourceProvider extends GenericDataSourceProvider {
private static final Log log = Log.getLog(SpannerDataSourceProvider.class);
public SpannerDataSourceProvider()
{
}
@Override
public void init(@NotNull DBPPlatform platform) {
}
@NotNull
@Override
public DBPDataSource openDataSource(
@NotNull DBRProgressMonitor monitor,
@NotNull DBPDataSourceContainer container)
throws DBException
{
return new SpannerDataSource(monitor, container, new SpannerMetaModel());
}
@Override
public String getConnectionURL(DBPDriver driver, DBPConnectionConfiguration connectionInfo) {
StringBuilder url = new StringBuilder();
url.append("jdbc:cloudspanner://localhost;");
return url.toString();
}
}
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* 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.spanner.model;
/**
* Snowflake constants
*/
public class SpannerConstants {
public static final String DRIVER_PROP_PROJECT_ID = "Project";
public static final String DRIVER_PROP_INSTANCE_ID = "Instance";
public static final String DRIVER_PROP_DATABASE_ID = "Database";
public static final String DRIVER_PROP_PVTKEYPATH = "PvtKeyPath";
}
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* 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.spanner.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.runtime.DBRProgressMonitor;
import java.util.HashMap;
import java.util.Map;
public class SpannerDataSource extends GenericDataSource {
public SpannerDataSource(DBRProgressMonitor monitor, DBPDataSourceContainer container, SpannerMetaModel metaModel)
throws DBException
{
super(monitor, container, metaModel, new SpannerSQLDialect());
}
@Override
protected Map<String, String> getInternalConnectionProperties(DBRProgressMonitor monitor, DBPDriver driver, String purpose, DBPConnectionConfiguration connectionInfo) throws DBCException {
Map<String, String> props = new HashMap<>();
props.put(SpannerConstants.DRIVER_PROP_PROJECT_ID, connectionInfo.getServerName());
props.put(SpannerConstants.DRIVER_PROP_INSTANCE_ID, connectionInfo.getHostName());
props.put(SpannerConstants.DRIVER_PROP_DATABASE_ID, connectionInfo.getDatabaseName());
props.put(SpannerConstants.DRIVER_PROP_PVTKEYPATH, connectionInfo.getProviderProperty(SpannerConstants.DRIVER_PROP_PVTKEYPATH));
return props;
}
}
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* 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.spanner.model;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.ext.generic.model.meta.GenericMetaModel;
import org.jkiss.dbeaver.model.DBPErrorAssistant;
import org.jkiss.dbeaver.model.exec.DBCQueryTransformProvider;
import org.jkiss.dbeaver.model.exec.DBCQueryTransformType;
import org.jkiss.dbeaver.model.exec.DBCQueryTransformer;
import org.jkiss.dbeaver.model.impl.sql.QueryTransformerLimit;
import org.jkiss.utils.CommonUtils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Spanner meta model
*/
public class SpannerMetaModel extends GenericMetaModel {
private Pattern ERROR_POSITION_PATTERN = Pattern.compile(" at \\[([0-9]+)\\:([0-9]+)\\]");
public SpannerMetaModel() {
}
/*
@Override
public DBPErrorAssistant.ErrorPosition getErrorPosition(Throwable error) {
String message = error.getMessage();
if (!CommonUtils.isEmpty(message)) {
Matcher matcher = ERROR_POSITION_PATTERN.matcher(message);
if (matcher.find()) {
DBPErrorAssistant.ErrorPosition pos = new DBPErrorAssistant.ErrorPosition();
pos.line = Integer.parseInt(matcher.group(1)) - 1;
pos.position = Integer.parseInt(matcher.group(2)) - 1;
return pos;
}
}
return null;
}
*/
}
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* 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.spanner.model;
import org.jkiss.dbeaver.ext.generic.model.GenericSQLDialect;
/**
* Snowflake constants
*/
public class SpannerSQLDialect extends GenericSQLDialect {
public SpannerSQLDialect() {
super("Spanner");
}
}
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* 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.spanner.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.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.ext.spanner.SpannerActivator;
import org.jkiss.dbeaver.ext.spanner.model.SpannerConstants;
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;
import java.util.Locale;
/**
* SpannerConnectionPage
*/
public class SpannerConnectionPage extends ConnectionPageAbstract implements ICompositeDialogPage
{
private static final Log log = Log.getLog(SpannerConnectionPage.class);
private Text projectText;
private Text instanceText;
private Text databaseText;
private TextWithOpenFile privateKeyFile;
private static ImageDescriptor logoImage = SpannerActivator.getImageDescriptor("icons/spanner_logo.png"); //$NON-NLS-1$
private DriverPropertiesDialogPage driverPropsPage;
public SpannerConnectionPage() {
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, SpannerMessages.label_connection, 2, 0, 0);
addrGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
projectText = UIUtils.createLabelText(addrGroup, SpannerMessages.label_project, ""); //$NON-NLS-2$
projectText.addModifyListener(textListener);
instanceText = UIUtils.createLabelText(addrGroup, "Instance", ""); //$NON-NLS-2$
instanceText.setToolTipText("Spanner Instance ID"); //$NON-NLS-1$
instanceText.addModifyListener(textListener);
databaseText = UIUtils.createLabelText(addrGroup, "Database", ""); //$NON-NLS-2$
databaseText.setToolTipText("Spanner Database ID"); //$NON-NLS-1$
databaseText.addModifyListener(textListener);
UIUtils.createControlLabel(addrGroup, SpannerMessages.label_private_key_path);
privateKeyFile = new TextWithOpenFile(addrGroup, SpannerMessages.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(SpannerConstants.DRIVER_PROP_PVTKEYPATH)));
}
}
@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(SpannerConstants.DRIVER_PROP_PVTKEYPATH, privateKeyFile.getText());
}
super.saveSettings(dataSource);
}
@Override
public IDialogPage[] getSubPages(boolean extrasOnly)
{
return new IDialogPage[] {
driverPropsPage
};
}
}
package org.jkiss.dbeaver.ext.spanner.views;
import org.eclipse.osgi.util.NLS;
public class SpannerMessages extends NLS {
private static final String BUNDLE_NAME = "org.jkiss.dbeaver.ext.spanner.views.messages"; //$NON-NLS-1$
public static String label_connection;
public static String label_private_key_path;
public static String label_project;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, SpannerMessages.class);
}
private SpannerMessages() {
}
}
label_connection=Connection
label_private_key_path=Private key path (p12 or JSON)
label_project=Project
label_connection=\u0421\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435
label_private_key_path=\u041F\u0443\u0442\u044C \u043A \u0437\u0430\u043A\u0440\u044B\u0442\u043E\u043C\u0443 \u043A\u043B\u044E\u0447\u0443 (p12 \u0438\u043B\u0438 JSON)
label_project=\u041F\u0440\u043E\u0435\u043A\u0442
......@@ -81,6 +81,7 @@
<module>org.jkiss.dbeaver.ext.snowflake.core</module>
<module>org.jkiss.dbeaver.ext.snowflake.ui</module>
<module>org.jkiss.dbeaver.ext.spanner</module>
<module>org.jkiss.dbeaver.ext.sqlite</module>
<module>org.jkiss.dbeaver.ext.vertica</module>
<module>org.jkiss.dbeaver.ext.vertica.ui</module>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册