/dearsql:dearsqlfrom dearsql
Queries and analyzes databases (PostgreSQL, MySQL, SQLite, DuckDB, SQL Server, Oracle, MongoDB, Redis, Cassandra) and S3 storage via DearSQL saved connections. Profiles tables, explains query plans, and reviews indexes for performance issues.
Ships in dearsql. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
DearSQL is the user's SQL client. Its saved connections (credentials encrypted, SSH tunnels included) are available to you as tools, over MCP (dearsql --mcp, tool names below) or as shell commands (dearsql <tool> ..., same names, same output). Results are compact text.
search_schema, run_query, ...): use them.dearsql tools once. It lists every command with its flags. -c <connection> takes a saved name, a URL or a database file; -d <database> picks the database (db.schema on PostgreSQL and SQL Server).dearsql: command not found: ask the user to install it (DearSQL → Settings → Command Line → Install 'dearsql' Command, or curl -fsSL https://dearsql.dev/install.sh | sh). Don't hunt for credentials elsewhere.list_connections when you don't know which connection. * marks what the user has selected; connection and database default to it.search_schema with 1-3 words ("invoice total", typos fine) before writing any SQL. Never guess table or column names.describe_table before a join or filter: types, keys, indexes, foreign keys in and out.run_query for one read-only statement. Put LIMIT (TOP on SQL Server) on exploration, aggregate in SQL instead of paging rows, and pass the cursor a result ends with to get the next page.profile_table before filtering on data you haven't seen: per column the null %, distinct count, min and max, and the common values of low-cardinality columns (first 100,000 rows, one bounded query).explain_query shows the plan without running it, then warnings tagged with a code ([filtered-full-scan], [repeated-full-scan], [sort-spill], [big-sort], [misestimate], [automatic-index]). analyze: true runs the statement for real numbers: read-only statements only, and it takes as long as the query.review_indexes checks the schema for foreign keys with no index ([unindexed-fk]) and indexes another one covers ([redundant-index]), with a statement to consider. One table with table, or all of them (up to 200).explain_finding <code> gives the fixed explanation: what it means, how to confirm, the usual fix, when to leave it. Quote it rather than improvising.CREATE INDEX / DROP INDEX to the user; on a big production table mention CREATE INDEX CONCURRENTLY (PostgreSQL) or an online DDL.diff_schema compares two databases (otherConnection, otherDatabase; dev against prod, or two schemas) and lists the statements that would make the first match the second: creates first, drops last, views left out. Nothing runs. Show the script, point out the drops (they lose data), and apply only what the user picks, through execute_sql.run_query rejects writes, and so should you unless the user asked for the change.execute_sql (MCP; the user approves each call, in the DearSQL chat or in your client) or dearsql exec in a shell. Show the exact statement first, one statement per call, with a WHERE you have checked with a SELECT count(*).list_objects lists buckets, or one folder of a bucket (bucket, prefix, a cursor for more). read_object returns the start of a file as text (maxBytes, default 16 KB): enough to see a CSV's header or a log's shape.copy_object (with move), delete_object, upload_object, download_object change things: same rules as writes. A key ending in / is a folder and everything in it.~/.dearsql/connections.db, master.key) or ask for passwords: the tools already connect.analyze or any write against a connection whose name or tags suggest production without saying so first.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
PostgreSQL, MySQL, SQLite, DuckDB, SQL Server, Oracle, MongoDB, Redis
database-client, sql-client, query-profiling, index-analysis, s3-storage
npx claudepluginhub dunkbing/dearsql --plugin dearsqlOther plugins' skills for the same job