Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问clear审计通过

supabase-databaseSupabase 数据库

Agent Skill

用于辅助数据库表结构、查询语句、迁移脚本和数据维护任务。它适合让 Agent 分析 schema、编写 SQL、排查查询问题、整理索引或生成迁移建议。使用时需要明确数据库类型、连接环境和目标表,区分只读分析与写入变更;涉及删除、更新、迁移和批量导入时,应优先 dry-run、备份或事务保护,避免误操作。

总安装

4,343

周安装

174

GitHub Stars

16

下载量

1,406
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:supabase-database(Supabase 数据库)
来源仓库:https://github.com/nice-wolf-studio/claude-code-supabase-skills
仓库路径:skills/supabase-database
安装命令:
npx skills add https://github.com/nice-wolf-studio/claude-code-supabase-skills --skill supabase-database
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/nice-wolf-studio/claude-code-supabase-skills --skill supabase-database

简介

用于辅助数据库表结构、查询语句和迁移脚本编写。

  • 适用于分析 schema、排查查询问题和生成迁移建议。
  • 可帮助整理索引和维护数据一致性。supabase-database 属于开发类 Skill,可作为该场景下的辅助能力补充。
  • 安装方式:通过 GitHub 仓库安装,使用前确认权限与维护状态。
  • 涉及删除或更新时应优先 dry-run 或事务保护。

SKILL.md

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:

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:

source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/supabase-api.sh"

Common Operations

SELECT - Query Data

Basic select all:

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:

# Get only id and name columns
supabase_get "/rest/v1/users?select=id,name,email"

Filter results:

# Equality filter
supabase_get "/rest/v1/users?select=*&email=eq.user@example.com"

# 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:

# 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:

# 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:

source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/supabase-api.sh"

supabase_post "/rest/v1/users" '{
  "name": "John Doe",
  "email": "john@example.com",
  "age": 30
}'

Insert multiple rows:

supabase_post "/rest/v1/users" '[
  {
    "name": "Alice Smith",
    "email": "alice@example.com"
  },
  {
    "name": "Bob Jones",
    "email": "bob@example.com"
  }
]'

Upsert (insert or update if exists):

# 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": "updated@example.com"
    }'

UPDATE - Modify Data

Update rows matching filter:

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": "newemail@example.com"
}'

# Update multiple rows
supabase_patch "/rest/v1/products?category=eq.electronics" '{
  "discount": 10
}'

DELETE - Remove Data

Delete rows matching filter:

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:

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

OperatorDescriptionExample
eqEqualsid=eq.123
neqNot equalsstatus=neq.deleted
gtGreater thanage=gt.18
gteGreater than or equalprice=gte.100
ltLess thanquantity=lt.10
lteLess than or equalscore=lte.50
likePattern match (case-sensitive)name=like.*John*
ilikePattern match (case-insensitive)email=ilike.*@gmail.com
isCheck for exact value (null, true, false)deleted_at=is.null
inIn liststatus=in.(active,pending)
notNegate a conditionstatus=not.in.(deleted,banned)
orLogical ORor=(status.eq.active,status.eq.pending)
andLogical ANDand=(age.gte.18,age.lte.65)

Response Formatting

Pretty print JSON (requires jq):

supabase_get "/rest/v1/users?select=*" | jq '.'

Extract specific field:

# Get just the names
supabase_get "/rest/v1/users?select=name" | jq -r '.[].name'

Count results:

# 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

result=$(supabase_get "/rest/v1/users?select=id&email=eq.test@example.com")
if [[ "$result" == "[]" ]]; then
    echo "User does not exist"
else
    echo "User exists"
fi

Create if not exists

# Check first
existing=$(supabase_get "/rest/v1/users?select=id&email=eq.test@example.com")

if [[ "$existing" == "[]" ]]; then
    # Create new user
    supabase_post "/rest/v1/users" '{
        "email": "test@example.com",
        "name": "Test User"
    }'
    echo "User created"
else
    echo "User already exists"
fi

Batch operations

# 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:

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

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

27.19%
按下载量换算382

Gemini CLI

21.66%
按下载量换算305

Codex

17.91%
按下载量换算252

OpenCode

13.09%
按下载量换算184

Antigravity

6.4%
按下载量换算90

windsurf

3.47%
按下载量换算49

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills