sql-executor

Execute SQL queries against SQLite, PostgreSQL, and MySQL databases with formatted output and CSV/JSON export.

84|15|Updated Dec 31, 2025
One-click install
npx skills add https://github.com/AIDotNet/MoYuCode --skill sql-executor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-executor
Source: https://github.com/AIDotNet/MoYuCode/tree/main/skills/tools/sql-executor
Command: npx skills add https://github.com/AIDotNet/MoYuCode --skill sql-executor

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill allows users to execute SQL queries against various database types, format the results, and export them, simplifying data retrieval and analysis tasks.

Core Features & Use Cases

  • Database Querying: Execute SQL commands against SQLite, PostgreSQL, and MySQL databases.
  • Result Formatting: Display query results in a human-readable table format.
  • Data Export: Export query results directly to CSV or JSON files.
  • Use Case: A user needs to quickly get a list of all customers from a PostgreSQL database who registered in the last month and save this list as a CSV file for a marketing campaign.

Quick Start

Execute the SQL query 'SELECT name, email FROM customers WHERE signup_date > "2023-01-01"' against the 'mydatabase.db' SQLite file and save the output to 'customers.csv'.

Frequently Asked Questions about sql-executor

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

FAQPage Schema
How do I execute SQL queries and export the results to a CSV file?

To execute SQL queries and export results, you can run SQL commands against SQLite, PostgreSQL, or MySQL databases and directly save the retrieved data as CSV or JSON files. This simplifies data retrieval and reporting tasks.

Can I run SQL queries against a PostgreSQL database and save the output to JSON?

Yes, you can run SQL queries against a PostgreSQL database and export the output to JSON. The skill supports PostgreSQL, MySQL, and SQLite, allowing you to format query results into human-readable tables or export them directly.

What do I need to connect to MySQL and execute SQL commands for data analysis?

To connect to MySQL and execute SQL commands, you need the database connection credentials. The skill utilizes Python's built-in sqlite3 module for SQLite, while requiring external libraries to support MySQL and PostgreSQL database interactions.

How do I query a SQLite database file and format the output as a table?

You can query a SQLite database file by providing the file path and the SQL command. The skill processes the query using Python's sqlite3 module and automatically formats the retrieved data into a human-readable table format for immediate analysis.

Does this tool support exporting database query results for marketing reports?

Yes, exporting database query results for marketing reports is fully supported. You can extract specific records, such as recent customer registrations from PostgreSQL, and export them directly to a CSV file for immediate downstream use.