Articles on: Integrations

Chat with Supabase PostgreSQL using BlazeSQL AI

Supabase aims to make Postgres easily accessible to all users. You can quickly get your PostgreSQL database up and running in a few minutes with features like vector search and authentication directly integrated into it.

If you're considering using Supabase PostgreSQL, then BlazeSQL is an AI-powered tool that can help you effortlessly uncover data insights.

BlazeSQL is an AI tool that integrates seamlessly with Supabase PostgreSQL. You can ask BlazeSQL questions about your data in natural language. The SQL AI understands what you're asking, digs through your data to find the right information, and creates clear charts and graphs to visualise the answer. It can also provide SQL queries.

It's like having a helpful data expert who does all the technical work for you - you just need to ask the questions you care about.

At the end of this tutorial, you will have:

Set up a PostgreSQL database running on Supabase,

Connected PostgreSQL to BlazeSQL, and

Queried your data by simply chatting with Blaze (our chatbot).

Setting up Supabase database



First, head to your Supabase dashboard and create your organization:

Create organization on Supabase

Create a new project. Give your project a name, select your hosting region, and click "Create new project."

Create new project in Supabase
For this tutorial, we have created tables and populated them with sample data.

Schema
Navigate to "Project Settings" -> "Database". You will see your connection credentials under "Database Settings."
Connection credentials

Create a free BlazeSQL account and connect to Supabase



Head on to BlazeSQL to create a free account. After signing up, sign in to access the database connection page.

Input your preferred database name in the input field and click "Next."

Add database
Choose your database type, in this case, PostgreSQL, to proceed to the next section.

Select database
In the next section, select the "Connect to Database" option and click "Next."

Database configuration
Host, Port, Matching DB Name, and Username: copy these from your Supabase connection credentials.

The password should be set to the password that you created while setting up your Supabase project.

Whitelist the BlazeSQL IP address in Supabase to restrict database access exclusively to BlazeSQL:

Click "BlazeSQL IP Address for Whitelisting" to view the BlazeSQL IP address.

Database connection credentials
Copy BlazeSQL IP address

BlazeSQL IP
In your Supabase dashboard, navigate to Settings > Database, then scroll down to the Network Restrictions section. Click 'Add Restriction' and select "Add IPv4 Restriction" from the drop-down menu.

Add IP restriction on Supabase
Paste the BlazeSQL IP address you copied earlier, then click "Save Restriction."

Add BlazeSQL IP address to Supabase
Click "Connect" to continue.

Database connection credentials Select the tables you want to work with and click "Done."

Select table
You will be redirected to the chat interface if the connection is successful.

BlazeSQL AI chat

Query and visualize your data



After successfully connecting BlazeSQL to Supabase, you can chat with your SQL AI to query your database. For example, let's start by asking BlazeSQL to graph the top three customers by revenue.

BlazeSQL AI Chat
Now that you have the graph, let's take it a step further and create a dashboard to display more insights.

To get started, click the options button on the graph to expand additional options.

More options on graph
Choose the "Add to Dashboard" option to either add to an existing dashboard or create a new dashboard.

Expanded options on graph
Create new dashboard.

Create new dashboard
Name your dashboard, add a description, and then click "Create" to create a new dashboard.

Name new dashboard
The chat is added to the dashboard.

Dashboard
You can easily add more elements to your dashboard, resize them, and drag each element to create your desired layout.

Click the options button on each element to view additional options.

Dashboard element

Enhancing BlazeSQL knowledge



To help BlazeSQL learn more about your company and database, click the Brain icon on the left side of the chat box.

BlazeSQL AI chat
For documentation and more information, click 'Help' in the left pane.

BlazeSQL chat

Updated on: 12/11/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!