Skip to content

Commit 4661169

Browse files
authored
Added a topic about configuring a YDB connection in DataGrip (#8462)
1 parent b378647 commit 4661169

14 files changed

+158
-3
lines changed
Loading
Loading
Loading
Loading
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Connecting to {{ ydb-short-name }} with DataGrip
2+
3+
[DataGrip](https://www.jetbrains.com/datagrip/) is a powerful cross-platform tool for relational and NoSQL databases.
4+
5+
DataGrip allows you to work with {{ ydb-short-name }} using the Java Database Connectivity ([JDBC](https://en.wikipedia.org/wiki/Java_Database_Connectivity)) protocol. This article demonstrates how to set up this integration.
6+
7+
8+
### Adding the {{ ydb-short-name }} JDBC Driver to DataGrip {#datagrip_ydb}
9+
10+
11+
To connect to {{ ydb-name }} from DataGrip, you need the {{ ydb-name }} JDBC driver.
12+
13+
To download the {{ ydb-short-name }} JDBC driver, follow these steps:
14+
15+
1. Go to the [ydb-jdbc-driver repository](https://github.com/ydb-platform/ydb-jdbc-driver/releases).
16+
17+
1. Select the latest release (tagged as `Latest`) and save the `ydb-jdbc-driver-shaded-<driver-version>.jar` file.
18+
19+
To add the downloaded JDBC driver to DataGrip, follow these steps:
20+
21+
1. In DataGrip, go to **File | Data Sources…**.
22+
23+
The **Data Sources and Drivers** dialog box appears.
24+
25+
1. In the **Data Sources and Drivers** dialog box, open the **Drivers** tab and click the **+** button.
26+
27+
1. In the **Name** field, specify `YDB`.
28+
29+
30+
1. In the **Driver Files** section, click the **+** button, choose **Custom JARs…**, specify the path to the previously downloaded {{ ydb-short-name }} JDBC driver (the `ydb-jdbc-driver-shaded-<driver-version>.jar` file), and click **OK**:
31+
32+
1. In the **Class** drop-down list, select `tech.ydb.jdbc.YdbDriver`.
33+
34+
![](./_assets/datagrip-ydb-driver.png)
35+
36+
1. Click **OK**.
37+
38+
### Creating a Connection to {{ ydb-name }} {#datagrip_ydb_connection}
39+
40+
To establish a connection, perform the following steps:
41+
42+
1. In DataGrip, go to **File | Data Sources…**.
43+
44+
The **Data Sources and Drivers** dialog box appears.
45+
46+
1. In the **Data Sources and Drivers** dialog box, on the **Data Sources** tab, click the **+** button and select `YDB`.
47+
48+
1. In the **Authentication** drop-down list, select an authentication method.
49+
50+
1. If you selected the `User & Password` authentication method, in the **User** and **Password** fields, enter your YDB login and password.
51+
52+
1. On the **General** tab, in the **URL** field, specify the following connection string:
53+
54+
```
55+
jdbc:ydb:<ydb_endpoint>/<ydb_database>?useQueryService=true
56+
```
57+
58+
Where:
59+
- `ydb_endpoint` — the [endpoint](../../concepts/connect.md#endpoint) of the {{ydb-name}} cluster.
60+
- `ydb_database` — the path to the [database](../../concepts/glossary.md#database) in the {{ydb-name}} cluster.
61+
62+
A complete list of authentication methods and connection strings for {{ ydb-name }} is provided in the [JDBC driver](https://github.com/ydb-platform/ydb-jdbc-driver) description.
63+
64+
![](./_assets/datagrip-ydb-connection.png)
65+
66+
1. Click **Test Connection** to verify the settings.
67+
68+
If all the settings are correct, a message appears indicating a successful connection test.
69+
70+
1. Click **OK** to save the connection.
71+
72+
73+
### Working with {{ ydb-name }} {#datagrip_ydb_connection}
74+
75+
With DataGrip you can view the list and structure of tables.
76+
77+
![](./_assets/datagrip-list-tables.png)
78+
79+
You can also execute queries on the data.
80+
81+
![](./_assets/datagrip-run-sql.png)

ydb/docs/en/core/integrations/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ In addition to its own native protocol, {{ ydb-name }} has a compatibility layer
1616
| Embedded UI | [Instruction](../reference/embedded-ui/index.md) | |
1717
| [DBeaver](https://dbeaver.com) | [Instruction](ide/dbeaver.md) | By [JDBC-driver](https://github.com/ydb-platform/ydb-jdbc-driver/releases)|
1818
| JetBrains Database viewer || By [JDBC-driver](https://github.com/ydb-platform/ydb-jdbc-driver/releases)|
19-
| [JetBrains DataGrip](https://www.jetbrains.com/datagrip/) | | By [JDBC-driver](https://github.com/ydb-platform/ydb-jdbc-driver/releases)|
19+
| [JetBrains DataGrip](https://www.jetbrains.com/datagrip/) | [Instruction](ide/datagrip.md) | By [JDBC-driver](https://github.com/ydb-platform/ydb-jdbc-driver/releases)|
2020
| Other JDBC-compatible IDEs || By [JDBC-driver](https://github.com/ydb-platform/ydb-jdbc-driver/releases)|
2121

2222

ydb/docs/en/core/integrations/toc_i.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ items:
1717
href: import-jdbc.md
1818
- name: DBeaver
1919
href: ide/dbeaver.md
20+
- name: DataGrip
21+
href: ide/datagrip.md
Loading
Loading
Loading

0 commit comments

Comments
 (0)