← 返回 Skills 市场
tobeyrebecca

database

作者 TobeyRebecca · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
71
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install godfery-database
功能描述
Connect to Supabase for database operations, vector search, and storage. Use for storing data, running SQL queries, similarity search with pgvector, and mana...
使用说明 (SKILL.md)

Supabase CLI

Interact with Supabase projects: queries, CRUD, vector search, and table management.

Setup

# Required
export SUPABASE_URL="https://yourproject.supabase.co"
export SUPABASE_SERVICE_KEY="eyJhbGciOiJIUzI1NiIs..."

# Required: SkillBoss API Hub key (for vector embeddings via /v1/pilot)
export SKILLBOSS_API_KEY="your-skillboss-api-key"

# Optional: for management API
export SUPABASE_ACCESS_TOKEN="sbp_xxxxx"

Quick Commands

# SQL query
{baseDir}/scripts/supabase.sh query "SELECT * FROM users LIMIT 5"

# Insert data
{baseDir}/scripts/supabase.sh insert users '{"name": "John", "email": "[email protected]"}'

# Select with filters
{baseDir}/scripts/supabase.sh select users --eq "status:active" --limit 10

# Update
{baseDir}/scripts/supabase.sh update users '{"status": "inactive"}' --eq "id:123"

# Delete
{baseDir}/scripts/supabase.sh delete users --eq "id:123"

# Vector similarity search
{baseDir}/scripts/supabase.sh vector-search documents "search query" --match-fn match_documents --limit 5

# List tables
{baseDir}/scripts/supabase.sh tables

# Describe table
{baseDir}/scripts/supabase.sh describe users

Commands Reference

query - Run raw SQL

{baseDir}/scripts/supabase.sh query "\x3CSQL>"

# Examples
{baseDir}/scripts/supabase.sh query "SELECT COUNT(*) FROM users"
{baseDir}/scripts/supabase.sh query "CREATE TABLE items (id serial primary key, name text)"
{baseDir}/scripts/supabase.sh query "SELECT * FROM users WHERE created_at > '2024-01-01'"

select - Query table with filters

{baseDir}/scripts/supabase.sh select \x3Ctable> [options]

Options:
  --columns \x3Ccols>    Comma-separated columns (default: *)
  --eq \x3Ccol:val>      Equal filter (can use multiple)
  --neq \x3Ccol:val>     Not equal filter
  --gt \x3Ccol:val>      Greater than
  --lt \x3Ccol:val>      Less than
  --like \x3Ccol:val>    Pattern match (use % for wildcard)
  --limit \x3Cn>         Limit results
  --offset \x3Cn>        Offset results
  --order \x3Ccol>       Order by column
  --desc              Descending order

# Examples
{baseDir}/scripts/supabase.sh select users --eq "status:active" --limit 10
{baseDir}/scripts/supabase.sh select posts --columns "id,title,created_at" --order created_at --desc
{baseDir}/scripts/supabase.sh select products --gt "price:100" --lt "price:500"

insert - Insert row(s)

{baseDir}/scripts/supabase.sh insert \x3Ctable> '\x3Cjson>'

# Single row
{baseDir}/scripts/supabase.sh insert users '{"name": "Alice", "email": "[email protected]"}'

# Multiple rows
{baseDir}/scripts/supabase.sh insert users '[{"name": "Bob"}, {"name": "Carol"}]'

update - Update rows

{baseDir}/scripts/supabase.sh update \x3Ctable> '\x3Cjson>' --eq \x3Ccol:val>

# Example
{baseDir}/scripts/supabase.sh update users '{"status": "inactive"}' --eq "id:123"
{baseDir}/scripts/supabase.sh update posts '{"published": true}' --eq "author_id:5"

upsert - Insert or update

{baseDir}/scripts/supabase.sh upsert \x3Ctable> '\x3Cjson>'

# Example (requires unique constraint)
{baseDir}/scripts/supabase.sh upsert users '{"id": 1, "name": "Updated Name"}'

delete - Delete rows

{baseDir}/scripts/supabase.sh delete \x3Ctable> --eq \x3Ccol:val>

# Example
{baseDir}/scripts/supabase.sh delete sessions --lt "expires_at:2024-01-01"

vector-search - Similarity search with pgvector

{baseDir}/scripts/supabase.sh vector-search \x3Ctable> "\x3Cquery>" [options]

Options:
  --match-fn \x3Cname>     RPC function name (default: match_\x3Ctable>)
  --limit \x3Cn>           Number of results (default: 5)
  --threshold \x3Cn>       Similarity threshold 0-1 (default: 0.5)
  --embedding-model \x3Cm> Model for query embedding (default: uses SkillBoss API Hub)

# Example
{baseDir}/scripts/supabase.sh vector-search documents "How to set up authentication" --limit 10

# Requires a match function like:
# CREATE FUNCTION match_documents(query_embedding vector(1536), match_threshold float, match_count int)

tables - List all tables

{baseDir}/scripts/supabase.sh tables

describe - Show table schema

{baseDir}/scripts/supabase.sh describe \x3Ctable>

rpc - Call stored procedure

{baseDir}/scripts/supabase.sh rpc \x3Cfunction_name> '\x3Cjson_params>'

# Example
{baseDir}/scripts/supabase.sh rpc get_user_stats '{"user_id": 123}'

Vector Search Setup

1. Enable pgvector extension

CREATE EXTENSION IF NOT EXISTS vector;

2. Create table with embedding column

CREATE TABLE documents (
  id bigserial PRIMARY KEY,
  content text,
  metadata jsonb,
  embedding vector(1536)
);

3. Create similarity search function

CREATE OR REPLACE FUNCTION match_documents(
  query_embedding vector(1536),
  match_threshold float DEFAULT 0.5,
  match_count int DEFAULT 5
)
RETURNS TABLE (
  id bigint,
  content text,
  metadata jsonb,
  similarity float
)
LANGUAGE plpgsql
AS $$
BEGIN
  RETURN QUERY
  SELECT
    documents.id,
    documents.content,
    documents.metadata,
    1 - (documents.embedding \x3C=> query_embedding) AS similarity
  FROM documents
  WHERE 1 - (documents.embedding \x3C=> query_embedding) > match_threshold
  ORDER BY documents.embedding \x3C=> query_embedding
  LIMIT match_count;
END;
$$;

4. Create index for performance

CREATE INDEX ON documents
USING ivfflat (embedding vector_cosine_ops)
WITH (lists = 100);

Environment Variables

Variable Required Description
SUPABASE_URL Yes Project URL (https://xxx.supabase.co)
SUPABASE_SERVICE_KEY Yes Service role key (full access)
SUPABASE_ANON_KEY No Anon key (restricted access)
SUPABASE_ACCESS_TOKEN No Management API token
SKILLBOSS_API_KEY Yes SkillBoss API Hub key (for generating embeddings via /v1/pilot)

Notes

  • Service role key bypasses RLS (Row Level Security)
  • Use anon key for client-side/restricted access
  • Vector search requires pgvector extension
  • Embeddings generated via SkillBoss API Hub /v1/pilot (type: embedding), compatible with 1536-dimension pgvector columns
安全使用建议
This skill implements a Supabase CLI and will need: SUPABASE_URL and a SUPABASE_SERVICE_KEY (service role key) plus SKILLBOSS_API_KEY for embeddings, and command-line tools like curl and jq. The registry metadata only declared SKILLBOSS_API_KEY, which is inconsistent — confirm the required environment variables before installing. Because the script uses a Supabase service role key (full access), only install if you trust the skill and are willing to grant full DB access; prefer creating a least-privilege API key or using row-level security and limited roles. Also verify you are comfortable sending text to the external embedding endpoint (api.heybossai.com). If you can't provide a limited key or audit the skill fully, treat this as high-risk and avoid granting service-role credentials or allowing autonomous invocation.
能力标签
requires-sensitive-credentials
能力评估
Purpose & Capability
The skill's stated purpose (Supabase DB operations, vector search) matches the script's behavior, but the registry's declared required env vars list only SKILLBOSS_API_KEY while the script actually requires SUPABASE_URL and SUPABASE_SERVICE_KEY (a Supabase service role key with full access). That omission is an incoherence: a database tool legitimately needs Supabase credentials, so the registry metadata should declare them.
Instruction Scope
SKILL.md and scripts instruct the agent to run scripts that: call Supabase REST/RPC endpoints using the service role key, run raw SQL via an exec_sql RPC, and call an external embedding service (https://api.heybossai.com/v1/pilot). The instructions reference and expect command-line tools (curl, jq) but the skill metadata did not declare these runtime dependencies. The script will transmit user query text to a third‑party embedding API — expected for vector search but worth noting.
Install Mechanism
There is no installer or external download; the skill is instruction-plus-included-script (scripts/supabase.sh). No network-based installer or archive extraction is present, which reduces install-time risk. The script itself will be installed as a file in the skill bundle.
Credentials
The script requires SUPABASE_SERVICE_KEY (service role key — full DB access) and SUPABASE_URL in addition to SKILLBOSS_API_KEY. The registry only lists SKILLBOSS_API_KEY. Requesting a Supabase service role key is high privilege for a skill; the credentials requested are broader than what the registry declares. Additionally, the script expects jq and curl but the declared required binaries are none.
Persistence & Privilege
always is false (good). The skill allows autonomous invocation (disable-model-invocation: false), which is the platform default. Combined with a Supabase service role key, autonomous invocation increases blast radius (an agent could run arbitrary queries in the DB). This is not a configuration error by itself, but users should be aware of the risk of giving an agent a full‑privilege DB key.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install godfery-database
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /godfery-database 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release – CLI tool for Supabase database, vector search, and storage operations. - Supports SQL queries, CRUD (create, read, update, delete), upsert, and table management from the command line. - Provides vector similarity search using pgvector and embeddings via SkillBoss API Hub integration. - Includes scripts for table listing, schema description, and stored procedure (RPC) calls. - Offers simple environment variable setup for authentication and service configuration. - Features comprehensive command documentation and setup guidance for vector search.
元数据
Slug godfery-database
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

database 是什么?

Connect to Supabase for database operations, vector search, and storage. Use for storing data, running SQL queries, similarity search with pgvector, and mana... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 71 次。

如何安装 database?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install godfery-database」即可一键安装,无需额外配置。

database 是免费的吗?

是的,database 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

database 支持哪些平台?

database 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 database?

由 TobeyRebecca(@tobeyrebecca)开发并维护,当前版本 v1.0.0。

💬 留言讨论