database-utils

Execute read-only SQL queries across MySQL, PostgreSQL, ClickHouse, and Doris databases.

1|Updated May 6, 2022
One-click install
npx skills add https://github.com/cloud-native-tools/cws-lib-bash --skill database-utils
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: database-utils
Source: https://github.com/cloud-native-tools/cws-lib-bash/tree/main/.specify/skills/database-utils
Command: npx skills add https://github.com/cloud-native-tools/cws-lib-bash --skill database-utils

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires mysql-connector-python, psycopg2-binary, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This skill solves the challenge of querying multiple heterogeneous database types (MySQL, PostgreSQL, ClickHouse, Doris) through a single, unified, and secure interface without risking accidental data modification.

Core Features & Use Cases

  • Unified Query Interface: Execute SELECT, SHOW, and EXPLAIN queries across different database protocols using one command.
  • Safety Guardrails: Enforces read-only sessions, query validation, and execution timeouts to prevent accidental data loss or resource exhaustion.
  • Use Case: Quickly explore table schemas or run ad-hoc data analysis queries on production databases without needing to manage multiple database-specific client tools.

Quick Start

Use the database-utils skill to execute a select query on the production database by specifying the database name and the SQL statement.

Frequently Asked Questions about database-utils

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

FAQPage Schema
How do I run safe read-only SQL queries across MySQL and PostgreSQL?▼

To run safe read-only SQL queries, you can use a unified interface that connects to MySQL and PostgreSQL while enforcing session-level constraints. This prevents accidental data modification by validating statements and restricting operations to SELECT, SHOW, and EXPLAIN.

Can I use a single command-line tool for data analysis on ClickHouse and Apache Doris?▼

Yes, you can use a single command-line tool for data analysis on ClickHouse and Apache Doris. The utility queries these heterogeneous database systems through their compatible protocols, enabling unified schema exploration without managing multiple database-specific clients.

How do I explore database schemas on production systems without risking data loss?▼

You can explore database schemas safely by executing read-only queries with enforced session constraints. The tool implements strict query validation and execution timeouts, ensuring operational safety and preventing resource exhaustion during ad-hoc data analysis on production systems.

What type of SQL statements are allowed when querying multiple heterogeneous database types?▼

When querying multiple heterogeneous database types, only SELECT, SHOW, and EXPLAIN statements are allowed. The interface enforces strict read-only sessions and query validation, rejecting any statements that could modify data or disrupt the database systems.

Do I need separate client tools to query PostgreSQL and MySQL for ad-hoc analysis?▼

No, you do not need separate client tools to query PostgreSQL and MySQL for ad-hoc analysis. A unified command-line interface executes safe queries across both protocols, simplifying the workflow by eliminating the need to manage multiple database-specific client applications.