database

Design database schemas, optimize SQL queries, and manage migrations for PostgreSQL, MySQL, and SQLite.

1|Updated Dec 10, 2025
One-click install
npx skills add https://github.com/markus41/lobbi-design-system --skill database-markus41
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database
Source: https://github.com/markus41/lobbi-design-system/tree/main/.claude/skills/database
Command: npx skills add https://github.com/markus41/lobbi-design-system --skill database-markus41

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires sqlalchemy, psycopg2-binary.

What problem does it solve?

This Skill provides comprehensive capabilities for designing efficient database schemas, writing optimized SQL queries, and managing migrations, ensuring robust and performant data storage for your applications.

Core Features & Use Cases

  • Schema Design: Create tables with UUIDs, foreign keys, indexes, and soft deletes for data integrity and performance.
  • SQL Querying: Write and optimize complex SQL queries, including joins, JSON operations, and window functions.
  • Migrations & ORM: Manage database schema changes and interact with databases using SQLAlchemy ORM.
  • Use Case: Design a PostgreSQL schema for agents and tasks, including UUIDs, foreign keys, and indexes, then write a SQL query to join them and count tasks per agent, ensuring data consistency and efficient retrieval.

Quick Start

Create a PostgreSQL table named 'agents' with columns 'id' (UUID primary key), 'name' (VARCHAR), and 'type' (VARCHAR).

Frequently Asked Questions about database

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

FAQPage Schema
How do I design a PostgreSQL schema with UUIDs and foreign keys?

Schema design involves creating tables with UUID primary keys, VARCHAR columns, and foreign key constraints to establish relationships. Use this Skill to define table structures with indexes and integrity constraints, then generate the SQL DDL statements for PostgreSQL, MySQL, or SQLite databases.

What's the best way to write optimized SQL queries with joins and window functions?

Optimized SQL queries combine JOINs, window functions, and proper indexing to retrieve data efficiently. This Skill helps you construct complex queries—including JSON operations on JSONB columns—and tune them for performance across PostgreSQL, MySQL, and SQLite.

How do I manage database migrations and schema changes with SQLAlchemy?

Database migrations track incremental schema changes over time using an ORM like SQLAlchemy. This Skill supports robust migration workflows, including adding columns, indexes, and constraints, while maintaining data consistency and enabling rollback if needed.

Can I use soft deletes and auditing timestamps in my database design?

Soft deletes via deleted_at columns and auditing timestamps preserve data history without physical deletion. This Skill implements these patterns alongside UUID primary keys and GIN indexes on JSONB columns for comprehensive PostgreSQL, MySQL, and SQLite schemas.

How do I optimize database indexes for query performance?

Index tuning improves query performance by reducing full-table scans. This Skill applies index strategies including GIN indexes for JSONB data and composite indexes for foreign key joins, ensuring efficient retrieval across PostgreSQL, MySQL, and SQLite.