Datagrip как создать базу данных
Перейти к содержимому

Datagrip как создать базу данных

  • автор:

Начало работы с DataGrip (1) — установка и управление источниками данных

В случае сетевого подключения соответствующий пакет jar будет автоматически загружен, а сети нет, и его необходимо импортировать локально (здесь нет демонстрации).

Начало работы с DataGrip — общие настройки (2)

Как и в IDEA, настройка настраивается, и источник тот же, с небольшой разницей (в основном настройка не требуется).

Если вы не использовали IDEA для разработки java, советую быть хорошим (смешно вручную)

Начало работы с DataGrip — Общие операции (3)

(Это резюме относится к версии 2016.2, без существенных отличий)

Далее воспользуемся DataGrip выполняет общие операции с базой данных, включая запросы данных, изменение данных, создание баз данных, таблиц и т. Д.

http://dl2.iteye.com/upload/attachment/0119/1263/6b0ffcc8-5829-326c-815b-80a476e19c2c.png
В верхней левой области показано текущее соединение с базой данных. После расширения будет отображаться такая информация, как таблицы базы данных. Если после расширения информации нет, вам необходимо выбрать соединение с базой данных и щелкнуть значок вращения выше для синхронизации. Параметр «Дополнительная схема», щелкните для переключения между различными схемами.

Щелкните правой кнопкой мыши выбранное соединение с базой данных и выберите Откройте консоль, вы можете писать операторы SQL в консоли справа.

http://dl2.iteye.com/upload/attachment/0119/1265/f2fc1c17-288a-3991-887b-716f59f8dab5.png

Интеллектуальное приглашение DataGrip очень круто. Будь то стандартные ключевые слова sql, имена таблиц, имена полей или даже поля, специфичные для базы данных, оно может запрашивать. Я должен вздохнуть, что это умное приглашение слишком мощное. Интеллектуальное приглашение Intellij IDEA также убивает eclipse. .

Законченный После оператора sql вы можете выбрать его и выполнить с помощью зеленой стрелки в верхнем левом углу электронного

http://dl2.iteye.com/upload/attachment/0119/1273/bebf5996-5c3e-37a8-8065-33243f8a5265.png
Вы также можете использовать комбинацию клавиш Ctrl + Enter. Если она выбрана, SQL будет выполняться напрямую. Если она не выбрана, если в консоли есть несколько SQL, вам будет предложено, какой SQL выполнить. Раньше я привык к операциям в dbvisualizer. В dbvisualizer курсор остается на текущем sql (sql заканчивается точкой с запятой), а нажатие сочетания клавиш Ctrl + автоматически выполнит текущий sql. Фактически, DataGrip также можно установить в настройке-> Database-General

http://dl2.iteye.com/upload/attachment/0119/1283/b4c05671-600a-3305-af48-3112ef44bf17.png
По умолчанию при выполнении оператора запрашивается запрос.После перехода к самому маленькому оператору, когда курсор находится на текущем операторе, нажатие Ctrl + Enter будет напрямую выполнять текущий оператор.

Результат выполнения оператора отображается внизу

http://dl2.iteye.com/upload/attachment/0119/1291/e6fc6a18-da4d-32b6-8c8e-670248b372b5.png
Если ширина столбца слишком мала, вы можете щелкнуть любой из столбцов и использовать сочетания клавиш Ctrl + Shift + стрелки влево и вправо, чтобы отрегулировать ширину. Если вы хотите настроить ширину всех столбцов, вы можете щелкнуть красное поле в верхнем левом углу, выбрать все строки и использовать Сочетания клавиш Ctrl + Shift + стрелки влево и вправо для настройки

Также очень удобно добавлять и удалять строки, верхняя часть Кнопки + и — могут напрямую добавлять строки или удалять выбранные строки. Редактирование столбцов также очень удобно. Дважды щелкните столбец, который нужно изменить, введите измененное значение и щелкните мышью по другим частям, чтобы завершить изменение

http://dl2.iteye.com/upload/attachment/0119/1295/0bc1c527-2d48-369b-bcf5-acada66255b9.png

Иногда нам нужно установить для поля значение null вместо пустой строки "". DataGrip также обеспечивает операцию градиента. Щелкните столбец правой кнопкой мыши и выберите "Установить значение null"

http://dl2.iteye.com/upload/attachment/0119/1297/6fc97e37-fb7f-3c01-a146-c9fba9e7cfa3.png
Для тех, кому нужно просматривать результаты в нескольких окнах, то есть если вы хотите, чтобы результаты запроса отображались на новой вкладке, вы можете щелкнуть кнопку с закрепленной вкладкой, и новый запрос не будет отображаться на текущей вкладке, но будет открыта новая вкладка.

http://dl2.iteye.com/upload/attachment/0119/1301/3eb0023a-740b-3f80-8014-464d885d7dbc.png

рядом, поблизости Консоль вывода отображает информацию журнала выполнения SQL, и вы можете видеть такую ​​информацию, как время выполнения SQL.

http://dl2.iteye.com/upload/attachment/0119/1299/83fa531c-91b4-3a02-b02f-296195f51058.png
Я просто спросил, кто еще такой подвесной инструмент! ! !

Создать новую таблицу довольно просто и умно, выберите подключение к базе данных, нажмите зеленую кнопку Выберите таблицу под знаком +. В открывшемся окне вы можете заполнить информацию о таблице.

http://dl2.iteye.com/upload/attachment/0119/1303/25102ef8-ac5b-303b-9c06-ee4308ffac9e.png http://dl2.iteye.com/upload/attachment/0119/1306/f00179e9-0fe9-351d-9455-66537440f5cc.png

Я спрошу вас, рады ли вы видеть это окно! ! !

Вы можете заполнить название таблицы и комментарий к таблице вверху и щелкнуть зеленый справа посередине. + Подпишите, чтобы добавить столбец, тип типа столбца также может быть автоматически заполнен, значок окна сообщения справа от значения по умолчанию можно щелкнуть, чтобы добавить комментарии к столбцу, а индексы и внешние ключи могут быть установлены на следующих вкладках

Все эти операции DDL будет отображаться прямо внизу

http://dl2.iteye.com/upload/attachment/0119/1310/32c24402-023f-3cad-a2dd-c8a42ace32d1.png
Я спрошу если ты боишься

После того, как таблица построена, вы можете нажать на значок таблицы, откройте представление таблицы

http://dl2.iteye.com/upload/attachment/0119/1312/9894cfcf-48b6-382d-ab2e-57e6be6a2a5f.png
Вы можете просматривать данные в таблице, а также можете просмотреть оператор DDL

Начало работы с DataGrip (4) — Экспорт данных

Выберите таблицу, в которую нужно экспортировать данные, щелкните правой кнопкой мыши, дамп данных в файл


То есть вы можете экспортировать операторы SQL в форме вставки и обновления, а также данные в форматах html, csv и json.

Также можно экспортировать в режиме просмотра результатов запроса


Щелкните значок загрузки в правом верхнем углу, и вы можете выбрать различные методы экспорта во всплывающем окне, такие как вставка sql, обновление sql, формат csv и т. д.

Если вы экспортируете в формат csv, вы также можете контролировать формат экспорта

Это результат открытия в Excel после экспорта.

Помимо экспорта данных, вы также можете импортировать данные

Выберите таблицу, щелкните правой кнопкой мыши -> Импортировать из файла, выберите файл для импорта


Обратите внимание, что если два параметра заголовка слева проверены при экспорте, если при импорте есть заголовок, также проверьте его, иначе количество столбцов не будет совпадать.

DataGrip использует расширенную навигацию и поиск (1)

1. Навигация по ключевым словам:

При написании sql в области редактирования текста datagrip нажмите и удерживайте клавишу Ctrl на клавиатуре, перемещая мышь к ключевому слову sql, например к имени таблицы, имени поля или имени функции, мышь станет типом руки, ключевым словом Он станет синим и подчеркнутым, щелкните, он автоматически найдет дерево объектов слева и выберет объект, по которому щелкнули


2. Быстро переходите к указанной таблице, представлению, функции и т. д .:

В datagrip используйте комбинацию клавиш Ctrl + N, чтобы открыть окно поиска, введите имя, необходимое для навигации, и нажмите Enter.


3. Глобальный поиск

Дважды нажмите клавишу Shift или щелкните значок поиска в правом верхнем углу мыши, появится всплывающее окно поиска и выполните поиск всего, что вы хотите.


4. Поиск набора результатов

Щелкните мышью в области просмотра набора результатов запроса, нажмите сочетание клавиш Ctrl + F, появится окно поиска, введите поисковый контент, поддержите регулярные выражения, отфильтруйте результаты

5. Перейдите к связанным данным.

Между таблицами будут существовать связи внешней проверки. При запросе вы можете напрямую найти связанные данные или связанные данные. Например, в таблице user1 есть поле внешней проверки classroom, указывающее на идентификатор первичного ключа таблицы classroom. При запросе данных таблицы classroom вы можете Щелкните правой кнопкой мыши поле идентификатора, перейдите к, ссылаясь на данные


Выберите, следует ли отображать первые данные или все данные


автоматически откроет данные в связанной таблице


Напротив, при запросе данных таблицы слов он также может автоматически найти родительскую таблицу

6, фильтрация данных набора результатов

Для набора результатов, открытого с помощью редактирования таблицы (выберите таблицу в дереве объектов, щелкните правой кнопкой мыши -> редактор таблицы), вы можете продолжить фильтрацию набора результатов с использованием условий, как показано на рисунке ниже, вы можете ввести фильтр условия where в разделе ввода в верхнем левом углу набора результатов

Вы также можете щелкнуть правой кнопкой мыши столбец, который должен фильтровать данные, фильтровать по

7, строка в столбец

Для таблиц с большим количеством полей вам нужно нажимать влево и вправо для просмотра данных, вы можете переключиться на отображение столбцов, используйте сочетание клавиш Ctrl + Q в области просмотра набора результатов

Выберите один идентификатор для просмотра части данных (отображение столбца), после выбора всех нажмите сочетание клавиш, чтобы просмотреть все (отображение столбца).

DataGrip использует расширенный (трех) текстовый редактор

datagrip предоставляет мощный редактор, который реализует режим редактирования столбцов notpad ++.

1. Режим нескольких курсоров

При редактировании sql вам может потребоваться ввести или удалить несколько символов одновременно, нажать alt + shift и щелкнуть мышью в разных позициях одновременно, появится несколько курсоров


2, комментарий кода

Выберите код для аннотирования и нажмите сочетание клавиш Ctrl + / или Ctrl + shift + /, чтобы прокомментировать код или отменить комментарий.


3. Редактирование столбца

Нажмите и удерживайте клавишу Alt на клавиатуре, удерживая нажатой левую кнопку мыши для перетаскивания, вы можете выбрать несколько столбцов, скопировать и вставить и т. Д.

В текстовом редакторе, почте, локальной истории, показать историю, вы можете просмотреть историю использованных SQL


История команд

Наконец, позвольте мне рассказать о плане выполнения, который меня больше всего беспокоит.

Щелкните правой кнопкой мыши свой sql в консоли

В яркой части значка ниже можно увидеть два варианта:

Первый план объяснения генерирует план выполнения, как показано на вкладке paln на рисунке ниже.

Второй план объяснения (необработанный) показан ниже.

Экспорт в excel (при условии, что mysql установлен локально)

1. Щелкните экспортированную базу данных правой кнопкой мыши и выберите дамп с mysqldump.

2. Настройте путь к mysqldump как к файлу mysqldump в каталоге bin mysql.

Quick start with DataGrip

This quick start guide will introduce you to the key concepts and help you with your first steps in DataGrip.

Also, you can check our introduction video that covers all major topics about the IDE: adding data sources, configuring connection options, working in the editor, and installing plugins.

Prerequisites

To complete this quick start guide, ensure that you have installed the following software:

Git — https://git-scm.com/ (if you plan to use Sakila dump files on Step 4)

Step 1. Create a new project

When you open DataGrip, you see the Welcome screen.

DataGrip displays the Welcome screen when no project is opened. For example, when you run DataGrip for the first time or when you close the only open instance of a project. From this screen, you can create a new project, open an existing project, or clone files from a Version Control System (VCS).

Creating a project

Create a new project by clicking the New Project button. A new project in DataGrip is a complex of your data sources, console and scratch files, and attached folders.

Alternatively, click Open to open a directory with an existing project.

In the Enter new project name field, type the name of your project.

After the project is created and opened, you will see an IDE interface with all tool windows hidden. Tool windows are tabs that are attached to the bottom and sides of the IDE window. You can rearrange and even detach them to use as separate windows, for example, on another monitor.

Tool windows provide access to development tasks: viewing your database structure, running and debugging your application, integration with version control systems and other external tools, code analysis, search, navigation, and so on.

Opening the database explorer

Expand Files and Database Explorer tool windows by clicking their tabs.

Step 2. Connect to a database

Depending on a database vendor (MySQL, PostgreSQL, Oracle), you need to create a corresponding data source connection. In this tutorial, we will use SQLite because, for other databases, you need a running instance of the database. It means that you need to install and configure them before creating a connection.

A database in SQLite is a single disk file. The file format is cross-platform. A database that is created on one machine can be copied and used on a different machine with a different architecture. DataGrip can create this file for you. So, all you need is to download drivers. The file default name is identifier.sqlite but you can change it.

If you want to connect to other database management systems (DBMS), refer to Create connection.

Open data source properties. You can open data source properties by using one of the following options:

Navigate to File | Data Sources .

In the Database Explorer ( View | Tool Windows | Database Explorer ), click the Data Source Properties icon .

On the Data Sources tab in the Data Sources and Drivers dialog, click the Add icon () and select SQLite .

Check if there is a Download missing driver files link at the bottom of the data source settings area. As you click this link, DataGrip downloads drivers that are required to interact with a database. The IDE does not include bundled drivers in order to have a smaller size of the installation package and to keep driver versions up-to-date for each IDE version.

You can specify your drivers for the data source if you do not want to download the provided drivers. For more information about creating a database connection with your driver, see Add a user driver to an existing connection.

To ensure that the connection to the data source is successful, click the Test Connection link.

To connect to an existing SQLite database, specify a file path to the database file in the File field. Also, to create a database, you can drag an SQLite DB file to the Database Explorer .

As the data source is ready, you will see it in the Database Explorer . The data source is presented as a tree with nodes. Also, along with the data source, DataGrip creates a query console. Query consoles are SQL files in which you can compose and execute SQL statements. They are already attached to your data source, unlike usual SQL files. So, you can start writing your queries to a database right away.

query console

Step 3. Attach a directory with SQL scripts

To run SQL scripts, you can right-click the data source and select SQL Scripts | Run SQL script . Alternatively, you can attach a folder with these scripts to the Files tool window and run them from here.

For illustration purposes, we will use Sakila dump files. You can get them by cloning the dumps repository. Note that you need to install Git to clone the repository.

Navigate to View | Tool Windows | Files on the menu.

In the Files tool window, right-click any area and select Attach Directory to Project .

Navigate to the directory that you want to attach. In our case, it is the dumps directory.

Also, to attach a directory, navigate to File | Open on the menu bar and select the directory in the file browser. You can find the attached directory in the Files tool window ( View | Tool Windows | Files ).

Step 4. Run dump files

The dumps repository includes scripts that generate the structure of the Sakila database and scripts that add data to database objects. Let’s run a script that generates objects in the main schema.

In the Files ( View | Tool Windows | Project ) tool window, navigate to the sqlite-sakila-db tree node.

Expand sqlite-sakila-db tree node.

Right-click the sqlite-sakila-schema.sql file and select Run ‘sqlite-sakila-schema. ‘ . Alternatively, press Ctrl+Shift+F10 .

In the Target data source / schema table, click the Add button () and select SQLite .

Step 5. Write your code

As you work in the editor, DataGrip analyzes your code, searches for ways to optimize it, and detects potential and actual problems. The following list includes basic features and tools that might be useful for your code writing and increase your productivity:

Code completion

Suggestions for code completion appear as you type your code. DataGrip has two types of code completion:

Basic code completion Ctrl+Space helps you complete names of tables, routines, types, and keywords within the visibility scope. When you invoke code completion, DataGrip analyzes the context and suggests the choices that are reachable from the current caret position. By default, DataGrip displays the code completion popup automatically as you type.

Smart code completion Ctrl+Shift+Space filters the suggestions list and shows only the types applicable to the current context.

The following animation shows the difference between basic and smart completion. Notice the number of variants that are suggested for different completion types

Generating code

DataGrip provides multiple ways to generate common code constructs and recurring elements, which helps you increase productivity. These can be either file templates used when creating a new file, custom or predefined live templates that are applied differently based on the context, various wrappers, or automatic pairing of characters.

From the main menu, select Code | Generate Alt+Insert to open the popup menu with available constructs that you can generate.

You can generate functions, procedures, views, and other database objects.

To generate an object, press Alt+Insert and select the object that you want to generate.

Live templates

Use live templates to insert common constructs into your code, such as statements or definitions of database objects.

The following video shows how you can use live templates.

To expand a code snippet, type the corresponding template abbreviation and press Tab . Keep pressing Tab to jump from one variable in the template to the next one. Press Shift+Tab to move to the previous variable.

To see the list of live templates, open settings Ctrl+Alt+S and navigate to Editor | Live templates .

Inspections

In DataGrip, there is a set of code inspections that detect and correct abnormal code in your project before you compile it. The IDE can find and highlight various problems, locate dead code, find probable bugs, spelling problems, and improve the overall code structure.

Inspections can scan your code in all project files or only in specific scopes (for example, only in production code or in modified files).

Every inspection has a severity level — the extent to which a problem can affect your code. Severities are highlighted differently in the editor so that you can quickly distinguish between critical problems and less important things. DataGrip comes with a set of predefined severity levels and enables you to create your own.

To see the list of inspections, open settings Ctrl+Alt+S and navigate to Editor | Inspections . Disable some of them, or enable others, plus adjust the severity of each inspection. You decide whether it should be considered an error or just a warning.

For example, the Redundant code in COALESCE call inspection reports all the arguments except for the first expression that does not evaluate to NULL.

Intention actions

As you work in the editor, DataGrip analyzes your code, searches for ways to optimize it, and detects potential and actual problems.

As soon as the IDE finds a way to alter your code, it displays a yellow bulb icon in the editor next to the current line. By clicking this icon, you can view intention actions available in the current context. Intention actions cover a wide range of situations from warnings to optimization suggestions. You can view the full list of intentions and customize them in the Settings dialog Ctrl+Alt+S .

To see the list of intention actions, open settings Ctrl+Alt+S and navigate to Editor | Intentions .

Click the light bulb icon (or press Alt+Enter ) to open the list of suggestions.

Select an action from the list and press Enter .

For example, you can use an intention action in the INSERT statement to create a table with valid field types:

Creating new database in DataGrip JetBrains

Anybody know how to create new database in DataGrip (database IDE from JetBrains)? Could not find in DataGrip Help page.

5 Answers 5

In DataGrip 2017.1 UI for this was introduced

enter image description here

You first define the database. File —> Data Sources and Drivers —> Click on the green ‘+’ in the top left corner to select the database type. And then fill in all the settings in the ‘General’ tab.

For example for PostgreSQL:

Once you are set up, Ctrl+Shift+F10 to open the console and you can type your SQL statements, e.g.:

USER_1's user avatar

I don’t believe the existing answers cover MySQL. In MySQL, creating a new schema is equivalent to creating a new database. For this case, contextual-click (usually right-click) on your connection in the navigation tree and choose New | Schema. Give it a name and ‘Execute in database».

The name of this schema will show up in the navigation tree and you can then add tables, data, etc.

HumanJHawkins's user avatar

The tricky part of creating a new database, is that you have to do it using a DataGrip «Data Source» where are are connected as a user that has the priviledge to create a database, which is generally the «admin» user that you added when you first installed Postgres which is connected to the main «postgres» database.

I like to keep track of all the commands I have run by attaching a new directory (File Menu | Attach Directory) and creating new files with descriptive names, such as «create_my_test_db.sql» and enter the sql to create the database:

When you want to execute this code, make sure that you are using the correct «console». DataGrip has a drop-down menu in the upper-right corner above your file menu, so make sure you have selected «postgres@localhost», since this is the user Data Source that has privileges to create a new database.

Similarly, to create a new user for this data base, create a new sql file «create_my_test_db_user.sql»

Then you can create a new Data Source, and set the properties to host = localhost, user = my_test_db_user, and password = keyboard_cat.

Datagrip как создать базу данных

image

image

image

image

image

Options

image

Schemas

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

Detailed tutorial about how to create your own custom Theme.
Blog post about creating custom themes for IntelliJ Platform

image

image

Getting Started with JetBrains DataGrip on a Distributed SQL Database

If you’re a database developer, you know the time saving value of an IDE in helping you create and navigate database objects, plus query and edit data from single UI. DataGrip from JetBrains is a well-rounded, visual database tool that supports almost 20 SQL and NoSQL databases from a single interface. And because YugabyteDB is PostgreSQL compatible, getting DataGrip to work with a distributed SQL database is relatively simple. In this post we’ll show you how to get DataGrip connected to a YugabyteDB cluster, use it to build a sample database, load it up with data and browse it.

What’s YugabyteDB? It is an open source, high-performance distributed SQL database built on a scalable and fault-tolerant design inspired by Google Spanner. Yugabyte’s SQL API (YSQL) is PostgreSQL wire compatible.

Introducing DataGrip

yugabytedb and datagrip

DataGrip boasts many of the must-have features you’d expect from a database GUI tool including:

  • Support for Multiple Databases – DataGrip is the multi-engine database environment. If the DBMS has a JDBC driver you can connect to it via DataGrip. It provides database introspection and various instruments for creating and modifying objects for the supported engines.
  • Database Objects – DataGrip introspects all objects in your databases and displays them in folders grouped by schemas. It also provides a UI for adding and editing tables, columns, indexes, constraints, etc.
  • Database Editor – The powerful data editor lets you add, remove, edit, and clone data rows. Navigate through the data by foreign keys and use the text search to find anything in the data displayed in the data editor.
  • Navigation – Quick navigation takes you to an object independent of whether it has just been created in your code, or it has already been read from a database. Navigate to the symbol action which lets you find objects by their name.
  • Writing SQL – DataGrip boasts a smart text editor, code completion, automatic code generation, code analysis, refactoring, and a variety of visual themes to suit your preferences.
  • Additional Features – DataGrip also has a query console, diff viewer, import/export wizards, VCS, and ER diagramming capabilities.

JetBrains offers a 30 day free trial, so you can try all the features before deciding if you’d like to sign on for a commercial subscription, which is very reasonably priced. Ok, let’s dive in and get DataGrip installed and connected to a YugabyteDB cluster!

Step 1: Install a Local YugabyteDB Cluster

Before we get into DataGrip, you’ll need to setup YugabyteDB and install a sample database. Although for the purposes of this blog post we’ll be installing everything on a macOS, both YugabyteDB and DataGrip support most major operating systems.

For complete instructions on how to get up and running on a variety of platforms including prerequisites, check out our Quickstart Guide. In the following section we’ll cover the basic steps for getting up and running in just a few minutes with a local 3 node cluster on your Mac laptop.

Download and Extract YugabyteDB

Note: At the time of this writing, 2.0.11 is the latest release of YugabyteDB. Make sure to check the Quickstart Guide for the latest version.

Configure Loopback Addresses

Add a few loopback IP addresses for the various YugabyteDB processes to use.

Create a 3 Node Cluster

With the command below, create a 3 node cluster with a replication factor of 3.

You can verify that your cluster is up and running by checking out the YugabyteDB Admin UI which is located at:

yugabytedb cluster creation confirmed

Step 2: Download and Install DataGrip

DataGrip can be downloaded from their website here:

As of this writing, version 2019.3.3 is what was tested against YugabyteDB. The installation is as simple on Mac as you’d expect.

installing datagrip for yugabytedb on a mac

Step 3: Connecting DataGrip to YugabyteDB

Next, you’ll want to configure a new database connection. Click on “+” > Datasource > PostgreSQL.

configuring yugabyte in datagrip

Configure the connection to YugabyteDB using the following values:

  • Name: YugabyteDB
  • Server Host or IP: localhost
  • Port: 5433 (Note that PostgreSQL’s default port assignment is 5432, while YugabyteDB uses 5433)
  • Database User: “yugabyte” is YugabyteDB’s default user
  • Password: None (by default)
  • Database: “postgres”

Select “Introspect using JDBC metadata”

On the “Options” tab you’ll want to check the “Introspect using JDBC metadata” box. YugabyteDB does not use PostgreSQL’s system columns given that these functions are handled by the DocDB storage engine of YugabyteDB. This option makes DataGrip’s PostgreSQL connector use standard JDBC metadata as opposed to PostgreSQL specific metadata.

Of course, it is always a good idea to test the connection to make sure everything is set up correctly before proceeding. Click the OK button and you are now ready to start exploring DataGrip.

Step 4: Create the Northwind Database

For the purposes of this blog post we’ll be using the Northwind sample database. You can download the DDL and data scripts here. Once you have downloaded the files, building the Northwind database on YugbyteDB is simple:

Open up a New Console in DataGrip and Create the Northwind Database

Right-click on YugabyteDB in the tree and select New Database. Name it northwind and execute.

Creating the Northwind Database YugabyteDB and DataGrip Example

Build the Northwind Tables and Objects

Click on YugabyteDB > northwind > Run SQL Script and load the DDL script to create the Northwind database objects.

Creating the Northwind database objects YugabyteDB DataGrip

At the end of the script execution you should see something like:

Load the Northwind Database with Data

Once again, click on YugabyteDB > northwind > Run SQL Script and load the DML script to load the Northwind database with data.

At the end of the script execution you should see something like:

Step 5: Test Drive DataGrip against a YugabyteDB Cluster

The first thing we can look at is a tree view of our database objects.

Tree view database objects YugabyteDB DataGrip how to

Expanding out a table allows us to inspect column properties and other attributes.

Expanding a table yugabytedb datagrip northwind how to

We can view the data in a table by simply double-clicking on a table in the tree.

Viewing data datagrip yugabytedb northwind example

Finally, we can run queries against the database by right clicking on northwind in the tree and selecting a New Console. For example, below we issued:

run queries yugabytedb datagrip northwind how to

That’s it! You can learn more about DataGrip’s features here, plus work through some of their tutorials on their Docs site.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *