Connecting to YDB with DBeaver

DBeaver is a free, cross-platform, open-source database management tool that provides a visual interface for connecting to various databases and executing SQL queries. It supports many database management systems, including MySQL, PostgreSQL, Oracle, and SQLite.

DBeaver allows you to work with YDB using the Java DataBase Connectivity (JDBC) protocol. This article demonstrates how to set up this integration.

Connecting the YDB JDBC Driver to DBeaver

To connect to YDB from DBeaver, you will need the JDBC driver. Follow these steps to download the JDBC driver:

  1. Go to the ydb-jdbc-driver repository.
  2. Select the latest release (tagged as Latest) and save the ydb-jdbc-driver-shaded-<driver-version>.jar file.

Follow these steps to connect the downloaded JDBC driver:

  1. In the top menu of DBeaver, select the Database option, then select Driver Manager:

    driver management

  2. To create a new driver, click the New button in the Driver Manager window that opens

    create new driver

  3. In the Create Driver window that opens, specify YDB in the Driver Name field:

    set name

  4. Go to the Libraries section, click Add File, specify the path to the previously downloaded YDB JDBC driver (the ydb-jdbc-driver-shaded-<driver-version>.jar file), and click OK:

    driver management

  5. The YDB item will appear in the list of drivers. Double-click the new driver and go to the Libraries tab, click Find Class, and select tech.ydb.jdbc.YdbDriver from the dropdown list.

    Warning

    Be sure to explicitly select the tech.ydb.jdbc.YdbDriver item from the dropdown list by clicking on it. Otherwise, DBeaver will consider that the driver has not been selected.

    driver management set

Creating a Connection to YDB

Perform the following steps to establish a connection:

  1. In DBeaver, create a new connection, specifying the YDB connection type.

  2. In the window that opens, go to the Main section.

  3. In the General subsection, in the JDBC URL input field, specify the following connection string:

    jdbc:ydb:<ydb_endpoint>/<ydb_database>?useQueryService=true
    

    Where:

    • ydb_endpoint — the endpoint of the YDB cluster to which the connection will be made.
    • ydb_database — the path to the database in the YDB cluster to which queries will be made.

    connection

  4. In the User and Password fields, enter the login and password for connecting to the database. A complete list of authentication methods and connection strings for YDB is provided in the JDBC driver description.

  5. Click Test Connection... to verify the settings.

    If all settings are correct, a message indicating successful connection testing will appear:

    connection test

  6. Click Finish to save the connection.

Working with YDB

With DBeaver, you can view the list and structure of tables:

structure

As well as execute queries on the data:

query