
Retool Database Query
FreeEffortlessly query Retool's PostgreSQL database.
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 source1. Install with the skills CLI
npx skills add civitai/civitai/retool-query --agent claude-code2. 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 civitaiRetool 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
| Flag | Description |
|---|---|
--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 |
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
- Read-only by default: Blocks write operations unless
--writableflag is used - Explicit permission required: Before using
--writable, you MUST ask the user for permission - Timeout protection: 30-second default timeout
When to Use
- Exploring the
UserNotestable 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
Create Data Lake Tables
Efficiently manage Iceberg tables on Amazon S3.
OneKGPd
Query individual-level data from the 1000 Genomes Project.
Database Lookup
Retrieve data from public APIs with precision and reproducibility.
BigQuery Basics
Manage datasets and run queries in BigQuery easily.
Query Data Lake
Efficiently execute SQL queries on Amazon Athena.
Find Data Lake Assets
Quickly resolve data lake asset references across AWS services.
