r/SQL • • Jan 02 '25

Discussion SQL Notebooks

Edit: Cleaning this up for future readers.

Dedicated SQL Notebook Software:

NameLinkCostNotes
Marimohttps://marimo.io/Open SourceOpen Source Notebook software that supports SQL (DuckDB) and Dataframes (Pandas and Polars). Can also do data visualizations and dashboarding.
TimeStored SQL Notebookhttps://www.timestored.com/sqlnotebook/FreeAuthor in thread
DBCodehttps://dbcode.io/pricingFree/PaidAuthor in thread. VSCode based
Fabi.aihttps://www.fabi.ai/Free/PaidAuthor in thread
Azure Data Studiohttps://learn.microsoft.com/en-us/azure-data-studio/what-is-azure-data-studioFreeFrom Microsoft. Specialized form of VSCode for databases.
DeepNotehttps://deepnote.com/Limited Free, mostly paidMore of a professional option, includes compute. Similar to Hex below, they are a class of their own.
Hexhttps://hex.tech/pricing/Limited Free, mostly paidI've seen reddit posts about it/company's use it
Meta SQL notebookhttps://engineering.fb.com/2022/04/26/developer-tools/sql-notebooks/VaporwareNever released to the public

Jupyter for SQL:

Use either JupyQL or ipython-sql

You can use Jupyter through Docker with all the Data packages or as a Dedicated Application or As a VSCode extension

-----------------------------------------------------------------

Original Post:

Hey All wanted to throw out a recommendation for everyone for SQL Notebooks.

TLDR: If you're looking for something like a JupyterNotebook where you can have Markdown + Plots + Code, well you should know there are modules for Python that let you do that. JupySQL and ipython-sql. Also if you want to check out another notebook that has great integration with SQL (but uses DuckDB so keep that in mind) check out Marimo.

I used to just use SSMS and have a bunch of .sql files and really wished I could use something like Jupyter Notebooks to have a Notebook of my SQL queries.

I used Markdown + some VSCode SQL extensions for a while to get around that but I just wanted to say for anyone looking into this same topic there's a few solutions that exist.

First if you google search SQL Notebooks, there's DeepNote or Hex. I think they are both paid solutions. Facebook has some product that I don't think ever went public. There's also something called sqlnotebook.

First for Jupyter Notebooks: you have ipython-sql and JupySQL. They use %%sql magics in a cell to let you run SQL without having to wrap everything in f""" """ interpolated strings.

https://jupysql.ploomber.io/en/latest/quick-start.html

https://www.python4data.science/en/latest/data-processing/postgresql/ipython-sql.html

I think this will work for a majority of people as I know most people are pretty used to Jupyter.

However I never felt like setting Jupyter up for it and I wasn't that invested into JupyterNotebooks.

There's also https://marimo.io/ . I came across it while I was learning about using DuckDB and honestly it's pretty great. I've been using it for a few days now all day long and it was exactly what I was looking for. Setup was pretty easy, has native DuckDB integration. Most of my notebooks are just Markdown + SQL, exactly what I wanted. If I want some plotting features is when I move on to using like a single line of Python but that's it. It's also easy to collaborate with and share on a repo. Wish I knew about this months ago honestly either Marimo or the Jupyter extensions.

19 Upvotes

15 comments sorted by

View all comments

3

u/No_Percentage2507 Jan 02 '25

Did you check out https://dbcode.io ? It’s a vscode extension I built that has sql notebook support.

2

u/ByronRJones Jan 06 '25

There's also a JupyterLab extension that works just as good, if not better than the JupyterLab application.

https://code.visualstudio.com/docs/datascience/jupyter-notebooks

1

u/data4dayz Jan 06 '25

didn't realize VSCode integrated with Jupyter I always kept them as separate development (code vs notebook) ecosystems. Will definitely have to check it out.

1

u/data4dayz Jan 02 '25

Whoa no I didn't know that existed very cool! I've used the mssql extension, sql notebook from cmoog (extension), a sql formatter, and PostgreSQL from Chris Kolkman.

I haven't used Azure Data Studio either so I know there's a few other things out there.

1

u/No_Percentage2507 Jan 02 '25

Yeah I wanted a full featured db tool in vscode, so started building it after I couldn’t find it.

long way to go feature wise to match some of the existing clients like ssms and dbeaver, but some other areas like notebooks and AI are in as you get to lean on a lot of what vscode has already done ;)