Supabase
Description
Section titled “Description”This module provides complete integration with Supabase through its APIs: Database (PostgREST) for CRUD operations with advanced filters, Storage for file management (upload, download, list, delete, signed URLs), Auth (GoTrue Admin) for user administration (CRUD, invitations) and Edge Functions for invoking Deno serverless functions.
For the database, filters are automatically converted to PostgREST format (column=op.value). UPDATE and DELETE operations require mandatory filters to protect data. Auth and Storage operations require the service_role key.
Configuration
Section titled “Configuration”| Parameter | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | Supabase credential (Project URL + API Keys) |
| operation | text | Yes | Operation: selectRows, insertRows, updateRows, deleteRows, rpc, storageUpload, storageDownload, storageList, storageDelete, authListUsers, authGetUser, authCreateUser, authUpdateUser, authDeleteUser, authInvite, invokeFunction |
| table | text | Conditional | Table or view name (DB operations) |
| select | text | No | Columns to return (default: *). Supports relations: *,posts(id,title) |
| filters | json | Conditional | Filter array: [{column, op, value}]. Operators: eq, neq, gt, gte, lt, lte, like, ilike, is, in, cs, cd, not |
| data | json | Conditional | Data to insert/update |
| order_by | text | No | Column to sort by |
| order_dir | select | No | Direction: asc, desc |
| limit | number | No | Record limit (default: 100) |
| offset | number | No | Offset for pagination |
| single | boolean | No | Return a single record as object |
| on_conflict | text | No | Column(s) for upsert |
| function_name | text | Conditional | PostgreSQL function or Edge Function name |
| bucket | text | Conditional | Storage bucket name |
| path | text | Conditional | File path in Storage |
| user_id | text | Conditional | User UUID (Auth operations) |
Credentials
Section titled “Credentials”Service type: supabase. Stored in the servicecredentials table.
Configuration fields:
- projectUrl: Supabase project URL (e.g.: https://xxxx.supabase.co)
- anonKey: Project anonymous key (for public read)
- serviceRoleKey: service_role key (for admin operations, Auth, Storage)
Output
Section titled “Output”{ "nextModule": null, "data": [ { "id": 1, "name": "Juan Garcia", "email": "juan@ejemplo.com", "status": "active" } ], "_meta_": { "operation": "selectRows", "recordCount": 1, "executionTime": "85ms" }}Usage Example
Section titled “Usage Example”Basic case - Read records
Section titled “Basic case - Read records”{ "credentials_id": 1, "operation": "selectRows", "table": "customers", "select": "id,name,email", "filters": [{"column": "status", "op": "eq", "value": "active"}], "order_by": "created_at", "order_dir": "desc", "limit": 50}Basic case - Insert record
Section titled “Basic case - Insert record”{ "credentials_id": 1, "operation": "insertRows", "table": "orders", "data": {"customer_id": 1, "total": 99.99, "status": "pending"}}API Used
Section titled “API Used”- Supabase PostgREST API:
/rest/v1/ - Supabase Storage API:
/storage/v1/ - Supabase Auth (GoTrue) API:
/auth/v1/ - Supabase Edge Functions:
/functions/v1/ - Documentation: https://supabase.com/docs
- UPDATE and DELETE operations require mandatory filters to avoid modifying/deleting the entire table
- The “in” operator accepts arrays that are automatically converted to PostgREST format: (val1,val2)
- Upsert mode is activated with on_conflict and uses the Prefer: resolution=merge-duplicates header
- Single mode returns an object instead of array (406 error if more than 1 result)
- Storage automatically detects content-type by extension if not specified
- Storage signed URLs expire according to the expires_in parameter (default: 3600 seconds)
- Auth operations require the service_role key (they don’t work with anonKey)
- Edge Functions are invoked with an extended timeout of 60 seconds
- General operation timeout is 30 seconds (120 for Storage upload/download)