Connect to Supabase
This workspace contains instructions and sample code to connect to and query a Supabase Postgres database through Workspace. This enables you to:
- Analyze the data in the Supabase database, like user growth or number of sessions. Which data or processes you want to analyze depends on the application that Supabase is powering.
- Automate reporting: you can use the "Schedule run" functionality to rerun your analysis on a schedule so that your report always takes in the latest available data as your app is being used.
Setup
Create a supabase project
If you don't have a Supabase project yet, go to supabase.com, create a free account, start a new project, and follow all the instructions. When setting a database password, make sure to store it somewhere, as you'll need to use this in the next step.
Locate your database credentials
Every Supabase project is powered by a Postgres database. To find the credentails of this database, from the Supabase dashboard, click the cog icon ("Settings") and select "Database". You'll see all the credentials you need:
Connect to the Database
In this workspace, in the left sidebar, click on "Databases", then "Connect Database", "Postgres" and configure the connection. Set "Password" to the password that you provided when setting up the supabase project in the first step.
You're all set!
Query your Supabase data
You can now create a new SQL cell, select the Supabase database connection and execute a query!
SELECT * FROM auth.sessions
Further reading
For a deeper dive on Supabase, check out its documentation.