sql-toolkit

Query, design, migrate, and optimize SQLite, PostgreSQL, and MySQL databases from the command line.

39|1|Updated Jul 2, 2026
One-click install
npx skills add https://github.com/HKU-MMLab/UniClawBench --skill sql-toolkit-hku-mmlab
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sql-toolkit
Source: https://github.com/HKU-MMLab/UniClawBench/tree/main/injection/101_skill_usage/task_101_06_sqlite_anomalies/skills/sql-toolkit
Command: npx skills add https://github.com/HKU-MMLab/UniClawBench --skill sql-toolkit-hku-mmlab

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working with relational databases often requires recalling dialect-specific syntax, connection flags, and optimization techniques across SQLite, PostgreSQL, and MySQL. This Skill consolidates those patterns so you can design schemas, write queries, run migrations, and tune performance without searching documentation. ## Core Features & Use Cases - Multi-Dialect Coverage: Provides concrete syntax for SQLite, PostgreSQL, and MySQL, including JSONB queries, enum types, and auto-increment differences. - Schema Design & Migrations: Includes table creation patterns, foreign keys, triggers, and a numbered SQL migration script with a tracking table. - Query Optimization: Covers EXPLAIN analysis, composite and partial indexes, covering indexes, and detecting unused indexes. - Use Case: You inherit a slow PostgreSQL reporting query. Use this Skill to run EXPLAIN ANALYZE, identify a sequential scan, and add a partial index that matches the query's filter conditions. ## Quick Start Ask the assistant to create a SQLite database with a users and orders table, then write a query showing each user's total spending.

Frequently Asked Questions about sql-toolkit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I import a CSV file into SQLite?▼

Use the sqlite3 CLI with .mode csv and .import to load a CSV directly into a table. For example: sqlite3 mydb.sqlite ".mode csv" ".import data.csv mytable". You can also run it in-memory for quick exploration without creating a file.

How do I find slow queries in PostgreSQL?▼

Run EXPLAIN (ANALYZE, BUFFERS) before your query to see the execution plan and actual timings. Look for Seq Scan on large tables, high Rows Removed by Filter, or large estimation mismatches, then add an appropriate index or run ANALYZE to refresh statistics.

What is the difference between PostgreSQL and MySQL auto-increment columns?▼

PostgreSQL uses SERIAL or identity columns, while MySQL uses AUTO_INCREMENT on an integer column. MySQL also requires specifying ENGINE=InnoDB and utf8mb4 charset explicitly for reliable defaults.

How do I query JSON data in PostgreSQL?▼

Use the ->> operator to extract JSONB fields as text, such as metadata->>'source', and the @> containment operator to match nested structures. Add a GIN index on the JSONB column to keep these queries fast on large tables.

How do I back up and restore a PostgreSQL database?▼

Use pg_dump -Fc to create a compressed custom-format backup and pg_restore with --clean --if-exists to restore it. For portable plain SQL, use pg_dump without -Fc and restore by piping the file into psql.

When should I use a partial index in PostgreSQL?▼

Use a partial index when queries consistently filter on a subset of rows, such as status = 'pending'. It is smaller and faster than a full index because it only indexes rows matching the WHERE clause, but it only helps queries with matching conditions.