Introduction
The Supabase data provider enables you to build Refine applications with Supabase, an open source Firebase alternative built on PostgreSQL. It provides full support for CRUD operations, real-time subscriptions, and authentication.Installation
Install the Supabase data provider package:Setup
Create Supabase project
First, create a Supabase project at supabase.com and get your API credentials from the project settings.
Basic Usage
Get List
Fetch a list of records from a Supabase table:Get One
Fetch a single record by ID:Create
Create a new record:Update
Update an existing record:Delete
Delete a record:Real-time Updates
The Supabase data provider supports real-time updates through Supabase’s subscription feature:liveMode: "auto", your lists will automatically update when data changes in Supabase.
Authentication
The Supabase data provider works seamlessly with Supabase authentication:Advanced Queries
Filtering
Supabase supports various filter operators:Joining Tables
Use theselect meta property to join related tables:
Custom Queries
Execute custom Supabase queries using themeta.select property:
Storage Integration
Work with Supabase Storage for file uploads:Row Level Security (RLS)
Supabase’s Row Level Security policies are automatically respected by the data provider. Configure RLS policies in your Supabase dashboard:Complete Example
Supported Operators
The Supabase data provider supports the following filter operators:eq: Equalsne: Not equalslt: Less thanlte: Less than or equalgt: Greater thangte: Greater than or equalin: In arraynin: Not in arraycontains: Contains (text search)containss: Contains (case-insensitive)null: Is nullnnull: Is not null
Next Steps
Data Providers Overview
Learn about other data providers
Supabase Documentation
Explore Supabase features