supabase-database
Perform database operations (CRUD) on Supabase tables using the REST API. Use for querying, inserting, updating, and deleting data in your Supabase database.
What this skill does
# Supabase Database Operations
## Overview
This skill provides tools for working with Supabase database tables through the REST API. Supports SELECT queries with filtering, INSERT, UPDATE, DELETE operations, and calling RPC functions.
## Prerequisites
**Required environment variables:**
```bash
export SUPABASE_URL="https://your-project.supabase.co"
export SUPABASE_KEY="your-anon-or-service-role-key"
```
**Helper script:**
This skill uses the shared Supabase API helper. Make sure to source it:
```bash
source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/supabase-api.sh"
```
## Common Operations
### SELECT - Query Data
**Basic select all:**
```bash
source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/supabase-api.sh"
# Get all rows from a table
supabase_get "/rest/v1/your_table?select=*"
```
**Select specific columns:**
```bash
# Get only id and name columns
supabase_get "/rest/v1/users?select=id,name,email"
```
**Filter results:**
```bash
# Equality filter
supabase_get "/rest/v1/users?select=*&[email protected]"
# Greater than
supabase_get "/rest/v1/products?select=*&price=gt.100"
# Less than or equal
supabase_get "/rest/v1/orders?select=*&quantity=lte.10"
# Pattern matching (LIKE)
supabase_get "/rest/v1/users?select=*&name=like.*John*"
# In list
supabase_get "/rest/v1/products?select=*&category=in.(electronics,books)"
# Is null
supabase_get "/rest/v1/users?select=*&deleted_at=is.null"
```
**Order and limit:**
```bash
# Order by column (ascending)
supabase_get "/rest/v1/posts?select=*&order=created_at.asc"
# Order by column (descending)
supabase_get "/rest/v1/posts?select=*&order=created_at.desc"
# Limit results
supabase_get "/rest/v1/posts?select=*&limit=10"
# Pagination (offset)
supabase_get "/rest/v1/posts?select=*&limit=10&offset=20"
# Range pagination
supabase_get "/rest/v1/posts?select=*" -H "Range: 0-9"
```
**Complex queries:**
```bash
# Multiple filters (AND)
supabase_get "/rest/v1/products?select=*&category=eq.electronics&price=gt.100"
# OR filter
supabase_get "/rest/v1/users?select=*&or=(status.eq.active,status.eq.pending)"
# Nested filters
supabase_get "/rest/v1/users?select=*,posts(*)&posts.published=eq.true"
```
### INSERT - Add Data
**Insert single row:**
```bash
source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/supabase-api.sh"
supabase_post "/rest/v1/users" '{
"name": "John Doe",
"email": "[email protected]",
"age": 30
}'
```
**Insert multiple rows:**
```bash
supabase_post "/rest/v1/users" '[
{
"name": "Alice Smith",
"email": "[email protected]"
},
{
"name": "Bob Jones",
"email": "[email protected]"
}
]'
```
**Upsert (insert or update if exists):**
```bash
# Use Prefer: resolution=merge-duplicates header
curl -s -X POST \
"${SUPABASE_URL}/rest/v1/users" \
-H "apikey: ${SUPABASE_KEY}" \
-H "Authorization: Bearer ${SUPABASE_KEY}" \
-H "Content-Type: application/json" \
-H "Prefer: resolution=merge-duplicates" \
-d '{
"id": 1,
"name": "Updated Name",
"email": "[email protected]"
}'
```
### UPDATE - Modify Data
**Update rows matching filter:**
```bash
source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/supabase-api.sh"
# Update specific row by id
supabase_patch "/rest/v1/users?id=eq.123" '{
"name": "Updated Name",
"email": "[email protected]"
}'
# Update multiple rows
supabase_patch "/rest/v1/products?category=eq.electronics" '{
"discount": 10
}'
```
### DELETE - Remove Data
**Delete rows matching filter:**
```bash
source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/supabase-api.sh"
# Delete specific row by id
supabase_delete "/rest/v1/users?id=eq.123"
# Delete multiple rows
supabase_delete "/rest/v1/logs?created_at=lt.2023-01-01"
```
### RPC - Call Database Functions
**Execute stored procedures:**
```bash
source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/supabase-api.sh"
# Call function without parameters
supabase_post "/rest/v1/rpc/function_name" '{}'
# Call function with parameters
supabase_post "/rest/v1/rpc/calculate_total" '{
"user_id": 123,
"start_date": "2023-01-01",
"end_date": "2023-12-31"
}'
```
## Filter Operators Reference
| Operator | Description | Example |
|----------|-------------|---------|
| `eq` | Equals | `id=eq.123` |
| `neq` | Not equals | `status=neq.deleted` |
| `gt` | Greater than | `age=gt.18` |
| `gte` | Greater than or equal | `price=gte.100` |
| `lt` | Less than | `quantity=lt.10` |
| `lte` | Less than or equal | `score=lte.50` |
| `like` | Pattern match (case-sensitive) | `name=like.*John*` |
| `ilike` | Pattern match (case-insensitive) | `email=ilike.*@gmail.com` |
| `is` | Check for exact value (null, true, false) | `deleted_at=is.null` |
| `in` | In list | `status=in.(active,pending)` |
| `not` | Negate a condition | `status=not.in.(deleted,banned)` |
| `or` | Logical OR | `or=(status.eq.active,status.eq.pending)` |
| `and` | Logical AND | `and=(age.gte.18,age.lte.65)` |
## Response Formatting
**Pretty print JSON (requires jq):**
```bash
supabase_get "/rest/v1/users?select=*" | jq '.'
```
**Extract specific field:**
```bash
# Get just the names
supabase_get "/rest/v1/users?select=name" | jq -r '.[].name'
```
**Count results:**
```bash
# Add Prefer: count=exact header for total count
curl -s -X GET \
"${SUPABASE_URL}/rest/v1/users?select=*" \
-H "apikey: ${SUPABASE_KEY}" \
-H "Authorization: Bearer ${SUPABASE_KEY}" \
-H "Prefer: count=exact" \
-I | grep -i content-range
```
## Common Patterns
### Check if record exists
```bash
result=$(supabase_get "/rest/v1/users?select=id&[email protected]")
if [[ "$result" == "[]" ]]; then
echo "User does not exist"
else
echo "User exists"
fi
```
### Create if not exists
```bash
# Check first
existing=$(supabase_get "/rest/v1/users?select=id&[email protected]")
if [[ "$existing" == "[]" ]]; then
# Create new user
supabase_post "/rest/v1/users" '{
"email": "[email protected]",
"name": "Test User"
}'
echo "User created"
else
echo "User already exists"
fi
```
### Batch operations
```bash
# Process multiple records
ids=(123 456 789)
for id in "${ids[@]}"; do
supabase_patch "/rest/v1/users?id=eq.$id" '{
"updated_at": "'"$(date -u +%Y-%m-%dT%H:%M:%SZ)"'"
}'
done
```
## Error Handling
The helper script automatically handles HTTP errors and displays them. Check return codes:
```bash
if supabase_get "/rest/v1/users?select=*"; then
echo "Query successful"
else
echo "Query failed"
exit 1
fi
```
## Security Notes
- Use **anon key** for client-side operations (respects Row Level Security)
- Use **service role key** for admin operations (bypasses RLS - use carefully)
- Always apply Row Level Security policies in your Supabase dashboard
- Never commit keys to version control
## API Documentation
Full Supabase REST API documentation: https://supabase.com/docs/guides/api
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.