New to Claude Skills? Learn how to install them →

civitai on GitHub

Retool Database Query

Free

Effortlessly query Retool's PostgreSQL database.

by civitai7.2k stars on civitai/civitai
1 views
Updated Aug 10, 2026
Get this skill

Free · Opens the source repo

What Retool Database Query does

The Retool Database Query skill enables users to execute SQL queries directly against a PostgreSQL database managed through Retool. This skill is particularly useful for developers and data analysts who need to access moderation notes and user data stored within the Retool environment. The default configuration is read-only, ensuring that users can safely explore data without the risk of unintended modifications.

With this skill, you can run various SQL commands to retrieve information from the UserNotes table or other tables within the database. The provided command structure allows for flexibility, including options to output results in JSON format, read queries from a file, and set a custom timeout for query execution. This makes it a powerful tool for anyone needing to interact with Retool's data programmatically.

The skill also includes safety features such as a default read-only mode, explicit permission requirements for write operations, and a timeout mechanism to prevent long-running queries from hanging. This ensures that users can work with the database efficiently and securely. Whether you are investigating user notes or exploring the schema of the database, this skill provides a straightforward way to access and manipulate data.

Overall, the Retool Database Query skill is an essential tool for developers and data professionals who require direct access to Retool-managed data for analysis, reporting, or integration purposes.

When to use it

Use this skill when you need to retrieve or explore data from Retool's PostgreSQL database, especially for user notes and moderation records.

When not to use it

This skill is not suitable for scenarios requiring extensive data manipulation or when write access is not explicitly permitted.

What you can build with it

Exploring UserNotes Schema

Run queries to view the structure of the `UserNotes` table, helping you understand the data model.

Retrieving User Moderation Notes

Look up moderation notes for specific users by querying the `UserNotes` table with user IDs.

Batch Processing Queries

Use the `--file` option to execute multiple queries stored in a file, streamlining your data access tasks.

How to install Retool Database Query

View source

1. Install with the skills CLI

npx skills add civitai/civitai/retool-query --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by civitai

Retool Database Query

Use this skill to query the Retool PostgreSQL database. This database stores moderation notes (UserNotes), and other data managed through Retool dashboards.

Running Queries

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

Options

FlagDescription
--writableAllow write operations (requires user permission)
--timeout <s>, -tQuery timeout in seconds (default: 30)
--file, -fRead query from a file
--jsonOutput results as JSON
--quiet, -qMinimal output, only results

Examples

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

# View UserNotes schema
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"

# JSON output
node .claude/skills/retool-query/query.mjs --json "SELECT * FROM \"UserNotes\" LIMIT 3"

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

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

Frequently asked questions about Retool Database Query

Similar skills