All Posts

Introducing Notebooks

SQL + Python notebooks with AI integration

March 21, 2025

Today, we’re introducing notebooks - a new feature that lets you combine SQL queries, Python code, and interactive tables & charts. All in one block-based interface similar to Jupyter Notebooks, running locally on your machine.

New to DB Pilot?

DB Pilot is a local database GUI client with a powerful AI integration. It works with PostgreSQL, MySQL, SQLite, DuckDB and other databases.

What you can do with notebooks

Here are a few examples of notebooks in action.

Build Dashboards

Notebooks also allow you to build dashboards with interactive charts and tables.

You can easily build analytical dashboards thanks to support for interactive charts and various types of input blocks, like date period selectors and text inputs.

You can also build operational dashboards. For example, you might have a dashboard that allows to filter by user email, then shows all relevant data for the given user and, if you want, allows to edit that data:

We’re also planning to add a “view” mode soon. That’ll clean up the UI, particularly for dashboard-like notebooks, by hiding some of the elements that are mostly only relevant while editing a notebook.

Iteratively load and transform data with SQL and Python

Notebooks make it simple to load data from multiple sources, then combine and transform it in any way you need - mixing SQL and Python seamlessly.

Below is a quick sample that shows how to combine SQL and Python for data loading and transformation.

What we’re doing here:

  1. Load some data with SQL
  2. Load some more data with Python
  3. Join those two datasets in SQL
  4. Join the two datasets in Python as an alternative

1. Load data with SQL

Here we load all users with their billing records from a Postgres database and store the query result as user_with_billing. We’ll explain later how the query results are stored and all the ways they can be accessed.

2. Load data with Python

Now we load some external data, in this case all Stripe payment intents along with the associated Stripe customer email. We store the result in a Pandas dataframe variable called payments_df.

Load data with Python

3. Join the results using SQL

Here we join the data using SQL. That is, using SQL we’re joining the result of the previous SQL query, user_with_billing, with the Python dataframe payments_df.

Join data with SQL

This is possible using the in-memory DuckDB database labeled “Notebook session database” that each notebook comes with. All Python dataframes and results of previous SQL queries are accessible through this database.

4. Join the results using Python

Results of SQL queries are also made available in Python. Meaning, we could also join the two datasets in Python instead of in SQL.

Join data with Python

AI Integration

You can use the inline AI assistant with SQL, Python, and table/chart blocks, like you’ve seen in the intro video at the top. For now, this is the recommended and best performing way to use AI in notebooks.

We’re also launching an initial version of notebook specific tools in the AI chat. This allows the assistant to suggest creation of multiple dependent blocks at once, e.g. to create a whole dashboard or analyze a piece of data. This is still an early version, which we’re planning to improve over the coming weeks.

Get started with DB Pilot

DB Pilot is a Database GUI client and SQL editor for PostgreSQL, MySQL, SQLite, DuckDB & more.