Перейти к содержимому

Как посмотреть базу данных в pycharm

  • автор:

Как открыть базу данных SQL в Pycharm?

Сейчас делаю проект на джанге, и появилась необходимость связать ряд полей. Хочу открыть базу данных, чтобы проверить названия этих полей, но что-то я не могу понять, как открыть таблицы для просмотра в pyCharm.

У меня такой вопрос: 1) Это вообще можно сделать? 2) Если да, то как это можно сделать?

  • Вопрос задан более трёх лет назад
  • 20428 просмотров
  • Facebook
  • Вконтакте
  • Twitter

idegree

1) Можно.
2) View -> Tool Windows -> Database

P.S. Зависит от редакции. В PyCharm Community Edition этой фичи нет.
29333659e84d49c0940d892eb9549b82.pngP.P.S. могу посоветовать использовать клиент базы данных, например MySQL Workbench или SQLiteman.

How to see what data inside an SQLite database using PyCharm? [closed]

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 4 years ago .

I am beginner in Python,I now using Flask and SQLAlchemy for creating simple database like below:

I am coming from PHP and MySQL background,so my question is:

I am using PyCharm IDE. I’ve heard that PyCharm has a built-in functionality to inspect a database. How can I view the contents of the database in PyCharm so that I can inspect the contents of the database visually instead of running queries in a console?

Русские Блоги

Первый шаг: открыть PyCharm, а затем База данных — Data Sourece — Sqlite;

Примечание. Если кнопка «База данных» не отображается в PyCharm, вы можете сделать следующее:
Вид — Окно инструментов — База данных, а затем База данных появится справа от кнопки PyCharm;

Шаг 2: Установите драйвер SQLite;
На следующем рисунке показано сообщение о том, что драйвер не установлен:

После установки драйвера:

Третий шаг: откройте файл базы данных и проверьте, успешно ли установлено соединение;

Шаг 4: Диаграмма успешного эффекта выглядит следующим образом:

Pycharm Community Edition Database Navigator Database Management Plugin (PLUGINS) Installation (SQLite as an example)

Since there is no built-in database plugin, it is installed.

[File File] -> [Setting Settings] -> [Plugins]

image-20210321110954141

Click Install, the installation is complete, click Restart Pycharm

In the sidebar DB Browser

I originally appeared on the left, I dragged him to the right.

image-20210321111140755

2, use (SQLite)

[1] DB Browser , Then click + Add database connection

image-20210321111431354

[2] We choose SQLite

image-20210321111635642

[3] Press the picture to click the red box button to add a database file.

RememberDon’tClick on the plus number to add a line

image-20210321111731987

[4] Add the database file, you can click Test Connection The test is successful

image-20210321111916134

The following pop-up window shows successful

image-20210321112032898

[5] Click OK to turn on the database connection

image-20210321112136019

[6] DB Browser Panel, find the table you created yourself

The picture below is the table I created in the Django project, not the default of the database exists.

image-20210321112245459

[7] Double click App01_user Open the table and click on the red frame in the pop-up window. No Filter I.e.

Because I still don’t write the filter

image-20210321112356389

3, add add data to the SQLite database

You can’t directly click on the blank to add data, you must pass . Buttons added, else will be wrong
image-20210321113050138

Such as pop-up window Could not create row in table "main.App01_user". [SQLITE_CONSTRAINT] Abort due to constraint violation (NOT NULL constraint failed: App01_user.password) error

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

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