Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I view the schema of my sqlite database in pycharm?

Tags:

sqlite

pycharm

I have sqlite database in a django project and everything works fine.

But seeing django dbshell does not work with sqlite I found pycharm has a database connector/manager but I can't find where I can input sql commands or see the schema.

Thanks

like image 466
maazza Avatar asked Nov 18 '15 08:11

maazza


People also ask

How do I find SQLite schema?

If you are running the sqlite3 command-line access program you can type ". tables" to get a list of all tables. Or you can type ". schema" to see the complete database schema including all tables and indices.

Does SQLite have schema?

SQLite doesn't support schemas. The path to the database file specified in the connection string.

How do I select a schema in PyCharm?

In the Database tool window (View | Tool Windows | Database), right-click a data source and navigate to Database Tools | Manage Shown Schemas. Select or clear checkboxes of schemas that you want to enable or disable. Press Enter .


2 Answers

Ok found it it is on the far right side of the window there is a "database" tab

In pycharm 5 pro at least

like image 176
maazza Avatar answered Oct 05 '22 03:10

maazza


TL;DR: For anyone coming across this problem, I fixed it with JetBrains toolbox. Just upgrade PyCharm, using default configurations.

Detailed Instructions

  1. Download JetBrains Toolbox, if you don't have it already.
  2. If you installed PyCharm via JetBrains Toolbox, then skip this step. Otherwise, uninstall PyCharm and then reboot.
  3. Launch Jetrbrains Toolbox, and enter your license information.
  4. Install / Update PyCharm using the Toolbox.
  5. Launch PyCharm using JetBrains Toolbox.
  6. If you are prompted to import configuration files from an older version of PyCharm, do not import. If you need those configurations, then I recommend manually setting them afterward.
  7. Open your existing project.
  8. Open the Database tool window (View -> Tool Windows -> Database)
  9. PyCharm should autodetect the Django Sqlite3 database.
  10. Click the notification, and it should add a data-source called Django default.
like image 33
Daniel Schetritt Avatar answered Oct 05 '22 02:10

Daniel Schetritt