Supabase
Automate database operations with Supabase and emma
With emma's Supabase integration, you can directly interact with your Supabase database. Manage tables, query data, and perform CRUD operations through automated workflows.
Features
Supabase_Operator supports the following 9 tools:
| Category | Tools | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Read Operations | 5 | |||||||||||||||||||
| ||||||||||||||||||||
| Write Operations | 4 | |||||||||||||||||||
| ||||||||||||||||||||
Main Parameters
| Parameter | Description |
|---|---|
| table | Name of the target table |
| columns | Columns to select (array of column names) |
| filter | Filter conditions for the query |
| order | Sort order (column and direction) |
| limit | Maximum number of rows to return |
| offset | Number of rows to skip (for pagination) |
| data | Data object for insert/update operations |
API Key Types and Permissions
Supabase offers two types of API keys. The operations you can perform depend on which key you use.
Anon Key
A public key with Row Level Security (RLS) applied.
- ✓ Read operations allowed
- ✓ Access restricted by RLS policies
- ✗ Cannot write/delete unless RLS allows
Service Role Key
A secret admin key that bypasses RLS.
- ✓ Full access to all tables
- ✓ Bypasses RLS for direct operations
- ⚠ Use only server-side, never expose publicly
Prerequisites
- • emma account
- • Supabase account
- • Supabase project with database
- • Supabase URL and anon/service key
Setup
1. Install the package
npm install @duzzle/supabase-integration2. Initialize
import { DuzzleSupabase } from '@duzzle/supabase-integration';
const supabase = new DuzzleSupabase({
apiKey: process.env.DUZZLE_API_KEY,
supabaseUrl: process.env.SUPABASE_URL,
supabaseKey: process.env.SUPABASE_ANON_KEY
});3. Select Data
// Select data from a table with filters
const { data, error } = await supabase.select({
table: 'users',
columns: ['id', 'name', 'email', 'created_at'],
filter: { status: 'active' },
order: { column: 'created_at', ascending: false },
limit: 10
});
console.log('Users:', data);4. Insert Data
// Insert new data into a table
const { data, error } = await supabase.insert({
table: 'posts',
data: {
title: 'New Post',
content: 'This is the content of the post',
author_id: 'user-123',
published: true
}
});
console.log('Inserted:', data);