retool-query

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Retool Database Query

Retool数据库查询

Use this skill to query the Retool PostgreSQL database. This database stores moderation notes (
UserNotes
), and other data managed through Retool dashboards.
使用此Skill查询Retool PostgreSQL数据库。该数据库存储审核备注(
UserNotes
)以及通过Retool仪表板管理的其他数据。

Running Queries

运行查询

bash
node .claude/skills/retool-query/query.mjs "SELECT * FROM \"UserNotes\" LIMIT 5"
bash
node .claude/skills/retool-query/query.mjs "SELECT * FROM \"UserNotes\" LIMIT 5"

Options

选项

FlagDescription
--writable
Allow write operations (requires user permission)
--timeout <s>
,
-t
Query timeout in seconds (default: 30)
--file
,
-f
Read query from a file
--json
Output results as JSON
--quiet
,
-q
Minimal output, only results
标记描述
--writable
允许写入操作(需要用户权限)
--timeout <s>
,
-t
查询超时时间(单位:秒,默认值:30)
--file
,
-f
从文件中读取查询语句
--json
以JSON格式输出结果
--quiet
,
-q
极简输出,仅显示结果

Examples

示例

bash
undefined
bash
undefined

List tables

列出所有表

node .claude/skills/retool-query/query.mjs "SELECT tablename FROM pg_tables WHERE schemaname = 'public'"
node .claude/skills/retool-query/query.mjs "SELECT tablename FROM pg_tables WHERE schemaname = 'public'"

View UserNotes schema

查看UserNotes表结构

node .claude/skills/retool-query/query.mjs "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_name = 'UserNotes'"
node .claude/skills/retool-query/query.mjs "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_name = 'UserNotes'"

Look up notes for a user

查找特定用户的备注

node .claude/skills/retool-query/query.mjs "SELECT * FROM "UserNotes" WHERE "userId" = 12345 ORDER BY created_at DESC LIMIT 10"
node .claude/skills/retool-query/query.mjs "SELECT * FROM "UserNotes" WHERE "userId" = 12345 ORDER BY created_at DESC LIMIT 10"

JSON output

JSON格式输出

node .claude/skills/retool-query/query.mjs --json "SELECT * FROM "UserNotes" LIMIT 3"
undefined
node .claude/skills/retool-query/query.mjs --json "SELECT * FROM "UserNotes" LIMIT 3"
undefined

Safety Features

安全特性

  1. Read-only by default: Blocks write operations unless
    --writable
    flag is used
  2. Explicit permission required: Before using
    --writable
    , you MUST ask the user for permission
  3. Timeout protection: 30-second default timeout
  1. 默认只读:除非使用
    --writable
    标记,否则阻止写入操作
  2. 需明确权限:在使用
    --writable
    之前,你必须获得用户的许可
  3. 超时保护:默认30秒超时时间

When to Use

使用场景

  • Exploring the
    UserNotes
    table schema
  • Looking up moderation notes for a specific user
  • Writing new moderation notes (with
    --writable
    )
  • Investigating Retool-managed data
  • 探索
    UserNotes
    表的结构
  • 查找特定用户的审核备注
  • 编写新的审核备注(需使用
    --writable
  • 调查由Retool管理的数据