Announcing marimo AI:

Get started

Support for SQL

Execute SQL queries directly in marimo notebooks with support for DuckDB, PostgreSQL, MySQL, SQLite and more. Interactive tables, visual tools, and seamless Python integration.

Support for SQL

While marimo is fundamentally a Python-first notebook environment, it recognizes that modern data analysis often requires working with data stored in databases. Rather than forcing you to switch between tools or write verbose Python database connection code, marimo provides first-class SQL support that feels natural and integrated. You can query your data where it lives, then seamlessly transition to Python for advanced analytics, machine learning, or visualization - all within the same notebook environment.

Whether you’re a data analyst comfortable with SQL looking to add Python capabilities, or a Python developer who needs to work with database-stored data, marimo’s integrated approach eliminates the friction traditionally associated with multi-language data workflows.

SQL cells

SQL cells work just like Python cells in marimo’s reactive system. When you execute a SQL query, the results become a Python variable that other cells can reference. This creates a smooth workflow where database queries feed directly into your analytical pipeline without manual data transfer steps. Changes to your SQL queries automatically trigger updates in dependent Python cells, maintaining marimo’s reactive consistency across both languages.

This approach is particularly powerful for exploratory data analysis where you might need to refine your data extraction logic while developing your analysis. Instead of repeatedly copying query results between tools, your notebook stays synchronized as both your queries and analysis evolve.

Many backends

When you write SQL marimo assumes DuckDB in memory by default, but marimo can also connect to PostgreSQL, SQLite, MySQL, and many other backends through standard database connectors.

DuckDB serves as an excellent default choice for analytical workloads. It’s embedded directly in your notebook process, requires no setup, and provides exceptional performance for analytical queries on moderate-sized datasets. You can load CSV files, Parquet files, or other data sources directly into DuckDB and start querying immediately.

PostgreSQL, MySQL, and other traditional databases work seamlessly when you need to query production systems or shared data warehouses. marimo handles connection management and credential configuration, making it easy to switch between different data sources within the same notebook.

Cloud data warehouses and datalakes like Snowflake, Apache Iceberg, BigQuery, and Redshift are also supported through their respective Python connectors.

The consistent SQL interface means your query skills transfer across all these backends, while marimo handles the connection details and result formatting automatically.

Interactive tools

SQL cells emit a table which benefits from the same visual tools that DataFrames use.

You can sort columns, filter rows, search for specific values, and get statistical summaries without writing additional code.