database-query

Connect to SQLite, MySQL, or PostgreSQL databases and run SQL queries via shell commands.

171|4|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/ntygod/ZhiWei --skill database-query-ntygod
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-query
Source: https://github.com/ntygod/ZhiWei/tree/main/src/main/resources/skills/database-query
Command: npx skills add https://github.com/ntygod/ZhiWei --skill database-query-ntygod

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Connect external databases (SQLite / MySQL / PostgreSQL) and run SQL queries through shell commands with safety controls.

Core Features & Use Cases

  • Supported databases: SQLite, MySQL, PostgreSQL, with safe, read-only by default (SELECT) and user-confirmed write operations.
  • Query & Export: Run SELECT queries and export results as CSV or JSON, or inspect table schemas (tables, columns, indexes).
  • Workflow use cases: Data exploration in analytics, data migration checks, or app development tasks requiring quick data access.

Quick Start

Connect to a database and run a sample SELECT to fetch the first 10 rows from a known table.

Frequently Asked Questions about database-query

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

FAQPage Schema
How do I securely query an external database using AI?

To securely query an external database, this tool executes SQL through shell commands with environment-based credential handling. It enforces a default read-only mode for SELECT queries and requires explicit user confirmation before performing any write operations.

Can I export SQL query results as CSV or JSON?

Yes, you can export SQL query results as CSV or JSON files. The tool supports running SELECT queries against SQLite, MySQL, and PostgreSQL databases and directly exporting the retrieved data into these formats for analytics or data migration checks.

Does this tool support inspecting table schemas in PostgreSQL?

Yes, this tool supports inspecting table schemas in PostgreSQL, as well as SQLite and MySQL. It provides dialect-specific command guidance to retrieve details about tables, columns, and indexes for safe data exploration and app development.

How are database credentials handled when connecting to MySQL?

Database credentials for MySQL connections are processed using environment-based credential handling. This approach securely manages authentication without exposing sensitive information directly in the command interface or query execution flow.

What is the best way to prevent accidental data writes during database exploration?

The best way to prevent accidental data writes is using the default read-only mode. This safety control automatically restricts operations to SELECT queries, requiring explicit user confirmation before authorizing any potentially destructive write commands to the database.

Can I run database queries for data analytics without installing database clients?

Yes, you can run database queries for analytics without standard client interfaces. The tool connects to SQLite, MySQL, and PostgreSQL directly through shell commands, utilizing dialect-specific guidance to execute queries and export results.