hs:databases

Design schemas and write queries for MongoDB and PostgreSQL databases.

Updated Jul 19, 2026
One-click install
npx skills add https://github.com/Dozyboy/VSF --skill hs-databases-dozyboy
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: hs:databases
Source: https://github.com/Dozyboy/VSF/tree/main/Day2_VSF/Demo1/harness/plugins/hs/disabled-skills/databases
Command: npx skills add https://github.com/Dozyboy/VSF --skill hs-databases-dozyboy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pymongo, psycopg2, and includes scripts (resource) and references (resource) components.

What problem does it solve? Designing database schemas, writing efficient SQL or MongoDB queries, and handling migrations, backups, and performance tuning require deep knowledge of two very different database systems, and mistakes lead to slow queries and fragile schemas. ## Core Features & Use Cases - Schema Design Guidance: Step-by-step rules for OLTP transactional tables, OLAP star schemas with fact/dimension tables, and incremental ETL watermark patterns, with stack-specific rules for MySQL, PostgreSQL, BigQuery, SQLite, and Cloudflare D1. - Migration & Backup Scripts: Python utilities to generate and apply migrations with rollback support, and to create compressed, verified backups for both MongoDB and PostgreSQL. - Performance Analysis: A script that detects slow queries, finds tables with excessive sequential scans, and recommends indexes for both database engines. - Use Case: Ask the assistant to design an orders schema for PostgreSQL, then run the performance check script against your database to get index recommendations for slow queries. ## Quick Start Ask the assistant to design a PostgreSQL schema for an orders and order_items feature with proper indexes and naming conventions.

Frequently Asked Questions about hs:databases

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

FAQPage Schema
How do I design a database schema for orders and users?▼

Follow the OLTP workflow: identify entities and query patterns, explore any existing schema, then propose DDL using snake_case plural table names, FK indexes, audit columns, and composite indexes matching your main queries. The skill requires user approval before executing any DDL.

How do I write a MongoDB aggregation pipeline?▼

Build pipelines by ordering stages efficiently: $match and $project early to reduce documents, then $group, $sort, and $limit. The references cover arithmetic, string, date, array, and conditional operators plus patterns like faceted search and window functions.

MongoDB vs PostgreSQL: which should I use for my application?▼

PostgreSQL fits relational data with complex joins, transactions, and strict integrity, while MongoDB fits document-oriented data with flexible schemas and embedded structures. The skill covers both so you can choose based on your data model and query patterns.

How do I find and fix slow queries in PostgreSQL?▼

Run the db_performance_check.py script with your connection URI and a millisecond threshold. It reads pg_stat_statements for slow queries, detects tables with high sequential scans, lists unused indexes, and outputs index recommendations.

Does the backup script expose database passwords in process lists?▼

No. For PostgreSQL the password is stripped from the URI and passed via the PGPASSWORD environment variable, and for MongoDB the URI is written to a temporary 0600-permission config file, keeping credentials out of the process argument list.

What are the limitations of Cloudflare D1 for schema design?▼

D1 is SQLite-based with a 10 GB size limit and single-threaded queries, so every query needs an index and batches must stay under 100k rows. It also lacks native comments, so metadata tables are required to document tables and columns.