Agent skill

database-operations

A skill for performing database CRUD operations following best practices. Includes guidance on session management, query building (filters, joins, aggregations), transaction handling, bulk operations, error handling, connection pooling, and query optimization. Provides reusable templates for database session dependencies, CRUD service classes, and transaction context managers.

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/database-operations

SKILL.md

Database Operations

Overview

This skill provides a set of best practices and reusable templates for common database operations in Python, primarily using SQLAlchemy. It is designed to help you build robust, efficient, and maintainable data access layers.

This skill follows the "Progressive Disclosure" design principle. This main file provides a high-level overview, and the references/ directory contains detailed documentation and code examples for each topic.

Core Concepts & Reference Guides

  • Session Management: Learn how to manage database sessions effectively, including a dependency injection pattern for web frameworks.

    • See references/session-management.md
  • CRUD Service Layer: A generic base class for creating, reading, updating, and deleting records. This promotes code reuse and a consistent API for data access.

    • See references/crud-service.md
  • Transaction Handling: A context manager to ensure that a series of operations are treated as a single, atomic unit of work.

    • See references/transactions.md
  • Querying Techniques: Examples of how to build more complex queries, including filtering, joins, aggregations, and high-performance bulk operations.

    • See references/query-examples.md
  • Advanced Topics: Guidance on handling common database errors, configuring the connection pool, and essential query optimization techniques to avoid performance bottlenecks.

    • See references/advanced-topics.md

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results