Create SQLite Database Connection By Drag-and-Drop

Drag-and-drop a .sqlite database file onto the Database tool to create a connection.

PyCharm Professional's Database tool, courtesy of DataGrip, is wonderful. It gives you a professional-level, visual way to work with SQL development in a project.

The Database tool needs to create database connection for the project, which not only lets you browse tables, edit rows, and perform queries, but it also injects superpowers into your Python code. Strings in Python that look like SQL get autocomplete, not only on SQL, but on the tables and columns in your project. Even refactoring those names.

But creating a database connection means filling in some details. For a SQLite database, it's a lot easier. Just drag and drop your .sqlite db file onto the Database tool window. Note: You might have to download the SQLite drivers.

Once done, your project has a database, you can browse the tables, and use the schema in your Python code's SQL strings.


Related Resources

View Database Definitions
View the definitions of database entities quickly in the Database Tool Window
Working with Multiple Databases in a JetBrains IDE
Oh drat! In your latest project, you need to use data from multiple different databases - and worse still, they’re different database types!
Working with SQLite Databases in any JetBrains IDE
In this video, you’ll see how you can skip messing around with the command line and connect to your database just by dragging and dropping.