sqlalchemy-orm-patterns

Design SQLAlchemy ORM models with explicit session boundaries and loading rules.

7|Updated Feb 14, 2026
One-click install
npx skills add https://github.com/KentoShimizu/sw-agent-skills --skill sqlalchemy-orm-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sqlalchemy-orm-patterns
Source: https://github.com/KentoShimizu/sw-agent-skills/tree/main/skills/sqlalchemy-orm-patterns
Command: npx skills add https://github.com/KentoShimizu/sw-agent-skills --skill sqlalchemy-orm-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

SQLAlchemy ORM workflow for model mapping, session/transaction boundaries, and query loading strategy. Use when SQLAlchemy ORM behavior must be implemented or revised with explicit persistence decisions; do not use for repository-wide architecture governance or release policy decisions.

Core Features & Use Cases

  • ORM modeling templates and relationship management that enforce explicit ownership and loading strategies
  • Session and transaction boundary policies that prevent leaks and ensure atomic operations
  • Use Case: Design an end-to-end ORM design for a domain model with clear session scope and query loading rules, then validate with a template and checklist

Quick Start

Provide an end-to-end ORM design for the given domain model using the included templates and references.

Frequently Asked Questions about sqlalchemy-orm-patterns

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

FAQPage Schema
How do I manage SQLAlchemy ORM session boundaries to prevent leaks in production?

SQLAlchemy ORM session boundaries prevent leaks by enforcing explicit persistence decisions and transactional integrity. You can apply session and transaction boundary policies that ensure atomic operations and clear ownership across services.

What's the best way to design SQLAlchemy ORM loading strategies for complex domain models?

Designing SQLAlchemy ORM loading strategies requires explicit loading rules to ensure efficient queries. You can use ORM modeling templates to enforce explicit ownership and apply loading strategies that maintain predictable transactional behavior.

When do I need explicit transactional integrity rules in SQLAlchemy ORM?

Explicit transactional integrity rules are needed when implementing production-grade data models requiring predictable transactional behavior. They ensure atomic operations and clear ownership across services during SQLAlchemy ORM model mapping.

Does this approach to SQLAlchemy ORM design work for microservices with separate database ownership?

This SQLAlchemy ORM design approach works for microservices by enforcing clear ownership across services. The ORM modeling templates and session boundary policies prevent leaks and ensure predictable transactional behavior between independent domain models.

How do I validate SQLAlchemy ORM relationship management and session scope before deployment?

You validate SQLAlchemy ORM relationship management by checking the design against a session and transaction checklist. This ensures explicit ownership, validates loading strategies, and confirms clear session scope for the domain model.

When should I not use SQLAlchemy ORM patterns for database architecture changes?

You should not use these SQLAlchemy ORM patterns for repository-wide architecture governance or release policy decisions. They are strictly for implementing or revising ORM behavior with explicit persistence decisions and session boundaries.