home / skills / openclaw / skills / database

database skill

/skills/0xterrybit/database

This skill helps you manage databases by connecting to SQL and NoSQL stores, running queries, and handling schemas with safety checks.

npx playbooks add skill openclaw/skills --skill database

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
714 B
---
name: database
description: Database management and queries. Connect to SQL and NoSQL databases, run queries, and manage schemas.
metadata: {"clawdbot":{"emoji":"🗄️","always":true,"requires":{"bins":["curl","jq"]}}}
---

# Database 🗄️

Database management and queries.

## Supported Databases

- PostgreSQL
- MySQL
- SQLite
- MongoDB
- Redis

## Features

- Run SQL queries
- Schema management
- Data export/import
- Backup and restore
- Performance monitoring

## Usage Examples

```
"Show all tables in database"
"Run query: SELECT * FROM users LIMIT 10"
"Export table to CSV"
```

## Safety Rules

1. **ALWAYS** confirm before DELETE/DROP operations
2. **WARN** about queries without WHERE clause

Overview

This skill provides database management and query capabilities for SQL and NoSQL systems. It connects to PostgreSQL, MySQL, SQLite, MongoDB, and Redis to run queries, manage schemas, and handle backups and exports. The focus is practical operations: querying, schema changes, data import/export, and basic performance checks. Safety prompts reduce risk on destructive operations.

How this skill works

The skill connects to target databases using supplied credentials and runs requested commands or queries. For SQL databases it executes SQL statements, lists tables, and manages schema migrations; for NoSQL systems it runs commands and reads/writes documents or keys. It supports exporting and importing data (CSV/JSON), creating backups, and initiating restores. Built-in checks prompt confirmations for destructive actions and warn on queries missing WHERE clauses.

When to use it

  • Inspect or list database schemas and tables
  • Run ad hoc SQL queries and return results
  • Export tables or collections to CSV/JSON
  • Create backups or restore from snapshots
  • Monitor basic performance metrics and slow queries

Best practices

  • Always provide a read-only account for routine inspections when possible
  • Confirm destructive operations explicitly before executing
  • Limit result sets with LIMIT or explicit filters to avoid heavy load
  • Use transactions for multi-step schema or data changes
  • Encrypt credentials and avoid sharing sensitive connection strings in chat logs

Example use cases

  • Show all tables and columns in a PostgreSQL database
  • Run: SELECT * FROM users LIMIT 10 and return results as JSON
  • Export an orders table to CSV for reporting
  • Create a backup of a MongoDB collection and restore it to a test instance
  • Warn and require confirmation before executing DROP TABLE or DELETE without WHERE

FAQ

Which databases are supported?

PostgreSQL, MySQL, SQLite, MongoDB, and Redis are supported.

How are destructive operations handled?

The skill always requests explicit confirmation before DROP or DELETE actions and warns about queries without WHERE clauses.