Connecting using an IDE
Yandex Query allows Java DataBase Connectivity (JDBC
This document describes connecting with DBeaver, but the connection process will be similar for any system supporting JDBC data sources.
DBeaver
DBeaver
JDBC driver
To connect to Yandex Query from DBeaver, you will need a JDBC driver. Yandex Query is based on YDB federated queries
Follow these steps to download the driver:
- Go to the ydb-jdbc-driver repository
. - Select the latest release (tagged
Latest
) and save theydb-jdbc-driver-shaded-<driver-version>.jar
file.
Connecting a JDBC driver to DBeaver
To connect a JDBC driver, follow these steps:
-
Select Database from the DBeaver top menu and click Driver management:
-
To create a new driver, click New in the Driver Manager window:
-
In the Create driver window that opens, specify
Yandex Query
in the Driver name field: -
Go to the Libraries section, click Add file, specify the path to the previously downloaded YDB JDBC driver and click OK:
-
The Yandex Query driver will appear in the driver list. Double click the new driver and go to the Libraries tab, click Find Class and select
tech.ydb.jdbc.YdbDriver
from the drop-down list.Warning
Make sure to explicitly select
tech.ydb.jdbc.YdbDriver
from the drop-down list by clicking it. Otherwise, DBeaver will assume that you have not selected a driver.
Creating a Yandex Query connection
To create a connection, you must complete these preliminary steps:
-
Create a service account named
dbeaver
with theeditor
role. -
Create an authorized key for the service account and save it to a file.
After that, follow these steps:
-
In DBeaver, create a new connection by specifying the
Yandex Query
connection type. -
In the window that opens, go to Main.
-
In the JDBC URL input field of the General subsection, specify the following path:
jdbc:ydb:grpcs://grpc.yandex-query.cloud.yandex.net:2135/<folder_id>?saFile=<path_to_auth_key_file.json>
Where:
folder_id
: ID of the folder in which queries to Yandex Query will be run.path_to_auth_key_file.json
: Path to authorized key file.
-
Click Test connection ... to test the settings.
If all settings are correct, you will get a successful connection test message:
-
Click Done to save the connection.
Working with Yandex Query
With DBeaver, you can view the list and structure of data bindings:
You can also run data queries: