Create SQLite Database Connection

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

PyCharm with Pro subscription includes our Database tool, DataGrip, which 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

Connect to a MongoDB database
Connect to a MongoDB database
Access a MongoDB database from your JetBrains IDE and do the work in the same window.
Querying Data from MongoDB Databases
Querying Data from MongoDB Databases
Run any queries you want against the database inside your JetBrains IDE.
Query MongoDB databases using SQL statements
Query MongoDB databases using SQL statements
Run MongoDB queries in SQL format within your IDE.