Supabase Database Queries

VerifiedCaution

Executes SQL queries against a Supabase PostgreSQL database for SELECT, INSERT, UPDATE, and DELETE operations. It connects using the DATABASE_URL from .env and accepts raw SQL or natural language descriptions of queries. Useful for interacting with tables like competition, team, race, admin, flight, halfflight, and feedback.

Sby Skills Guide Bot
Data & AIIntermediate
1106/2/2026
Claude CodeCursorWindsurf
#database#sql#supabase#postgresql#queries

Recommended for

Our review

Executes SQL queries against a Supabase PostgreSQL database, with automatic query generation from natural language descriptions and built-in safety measures.

Strengths

  • Accepts raw SQL or constructs queries from user descriptions
  • Formats results in a readable way
  • Includes safety guards: confirmation for UPDATE/DELETE and default LIMIT 100
  • Lists available tables and can describe their structure

Limitations

  • Requires a pre-defined DATABASE_URL environment variable
  • Limited to the specific tables of the icl-sail project (competition, team, race, etc.)
  • Not a full SQL client for complex transactions
When to use it

When you need to query or manipulate the icl-sail Supabase database tables via SQL.

When not to use it

For interacting with other databases or for operations requiring advanced ACID transactions.

Security analysis

Caution
Quality score85/100

The skill uses Bash to run psql with credentials from .env and executes arbitrary SQL from user input. While it includes safety guidelines like confirming destructive operations, the potential for data leakage or credential exposure warrants caution.

Findings
  • Arbitrary SQL execution via user-provided arguments could lead to data leakage or destruction if mishandled.
  • Sourcing .env in Bash could expose database credentials to the environment.
  • No input sanitization; user could inject shell commands if argument hint is not properly escaped.

Examples

List all competitions
Show all rows from the competition table.
Count teams
How many teams are there in the team table?
Preview and delete old feedback
Delete all feedback entries older than January 1, 2024.

name: db description: Query and manipulate the Supabase PostgreSQL database. Use for SELECT, INSERT, UPDATE, DELETE operations. argument-hint: [SQL query or description] allowed-tools: Bash, Read

Database Skill

Execute SQL queries against the icl-sail Supabase database.

Connection

The database connection URL is stored in .env as DATABASE_URL. Load it before running queries:

source .env && psql "$DATABASE_URL" -c "YOUR_QUERY"

Available Tables

  • competition - Competition configurations (id, name, host, announcements, flags)
  • team - Team information (~51 rows)
  • race - Race results (~309 rows)
  • admin - Admin users (~21 rows)
  • flight - Flight information (~9 rows)
  • halfflight - Half flight data (~13 rows)
  • feedback - User feedback (~1 row)

Instructions

When the user provides $ARGUMENTS:

  1. If it's a raw SQL query, execute it directly
  2. If it's a description of what they want, construct the appropriate SQL
  3. For destructive operations (UPDATE, DELETE, DROP), confirm with the user first
  4. Always show the results in a readable format

Examples

List all tables:

source .env && psql "$DATABASE_URL" -c "\dt public.*"

Query with nice formatting:

source .env && psql "$DATABASE_URL" -c "SELECT * FROM competition;"

Describe a table:

source .env && psql "$DATABASE_URL" -c "\d+ public.competition"

Safety

  • Never DROP tables without explicit user confirmation
  • Always LIMIT large result sets (default to LIMIT 100)
  • For UPDATE/DELETE, show a SELECT first to preview affected rows
Related skills