python-database-guidelines

Community

SQLAlchemy ORM patterns & Alembic migrations.

Authorimehr
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This skill provides structured patterns and best practices for building Python data access layers using SQLAlchemy ORM, async sessions, and Alembic migrations. It helps teams implement clean architecture in Python projects and reduces boilerplate by offering reusable templates and examples.

Core Features & Use Cases

  • Model Definition: Declarative ORM models with base classes and timestamp mixins to ensure consistency and auditability.
  • Async Session Setup & Transactions: Async engines, session factories, and safe commit/rollback patterns for high-concurrency apps.
  • Repository Pattern: Centralized CRUD operations and query helpers to decouple business logic from data access.
  • Complex Queries & Migrations: Examples of joins, eager loading, aggregations, and migration workflows with Alembic.
  • Use Case: Rapidly scaffold a Python service with a maintainable data layer aligned to Clean Architecture.

Quick Start

    1. Install dependencies: pip install SQLAlchemy alembic
    1. Define a Base model and a sample User model with a timestamp mixin
    1. Initialize Alembic and create migrations: alembic init alembic; alembic revision --autogenerate -m "init"; alembic upgrade head

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: python-database-guidelines
Download link: https://github.com/imehr/vet/archive/main.zip#python-database-guidelines

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.