Prerequisites
First, start by installing Marimo and setting up a notebook according to the Marimo quickstart documentation. You will also need the following packages:Connecting to the database
Use SQLAlchemy to create a connection engine. The connection string format is:<host> with your database FE host.
Using Marimo UI for credentials
To avoid hardcoding credentials, use Marimo’s interactive UI elements to collect them at runtime. Cell 1 — render input fields:Querying the database
With the engine established, use pandas to run queries: