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).
First, head to your Supabase dashboard and create your organization:
Create a new project. Give your project a name, select your hosting region, and click "Create new project."
For this tutorial, we have created tables and populated them with sample data.
Navigate to "Project Settings" -> "Database". You will see your connection credentials under "Database Settings."
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."
Choose your database type, in this case, PostgreSQL, to proceed to the next section.
In the next section, select the "Connect to Database" option and click "Next."
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.
Copy BlazeSQL IP address
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.
Paste the BlazeSQL IP address you copied earlier, then click "Save Restriction."
Click "Connect" to continue.
Select the tables you want to work with and click "Done."
You will be redirected to the chat interface if the connection is successful.
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.
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.
Choose the "Add to Dashboard" option to either add to an existing dashboard or create a new dashboard.
Create new dashboard.
Name your dashboard, add a description, and then click "Create" to create a new dashboard.
The chat is added to the 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.
To help BlazeSQL learn more about your company and database, click the Brain icon on the left side of the chat box.
For documentation and more information, click 'Help' in the left pane.
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 a new project. Give your project a name, select your hosting region, and click "Create new project."
For this tutorial, we have created tables and populated them with sample data.
Navigate to "Project Settings" -> "Database". You will see your connection credentials under "Database Settings."
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."
Choose your database type, in this case, PostgreSQL, to proceed to the next section.
In the next section, select the "Connect to Database" option and click "Next."
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.
Copy BlazeSQL IP address
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.
Paste the BlazeSQL IP address you copied earlier, then click "Save Restriction."
Click "Connect" to continue.
Select the tables you want to work with and click "Done."
You will be redirected to the chat interface if the connection is successful.
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.
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.
Choose the "Add to Dashboard" option to either add to an existing dashboard or create a new dashboard.
Create new dashboard.
Name your dashboard, add a description, and then click "Create" to create a new dashboard.
The chat is added to the 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.
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.
For documentation and more information, click 'Help' in the left pane.
Updated on: 12/11/2024
Thank you!