sqlalchemy-models

Generate SQLAlchemy models and database infrastructure from structured data model descriptions.

Updated Feb 20, 2026
One-click install
npx skills add https://github.com/jota-batuta/batuta-dots --skill sqlalchemy-models
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sqlalchemy-models
Source: https://github.com/jota-batuta/batuta-dots/tree/main/BatutaClaude/skills/sqlalchemy-models
Command: npx skills add https://github.com/jota-batuta/batuta-dots --skill sqlalchemy-models

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generates a complete SQLAlchemy-based data layer from a structured data model: core database setup, ORM models with relationships, and optional migration scaffolding, enabling rapid, consistent backend development.

Core Features & Use Cases

  • Core database infrastructure: engine, SessionLocal, and Declarative Base to support both production (PostgreSQL) and testing (SQLite) environments.
  • Model generation: auto-create models with one-to-many, many-to-many relationships using explicit back_populates and cascade rules.
  • Init and migration support: provide an initialization workflow to create tables and prepare Alembic-style migrations.
  • Testing scaffolding: guidance for SQLite-based tests with isolated schemas.

Quick Start

Provide a data model description and relationships; the system will generate the database layer, models, and optional migrations.

Frequently Asked Questions about sqlalchemy-models

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

FAQPage Schema
How do I auto-generate SQLAlchemy models from a structured data description?

To auto-generate SQLAlchemy models, provide a structured data model description to define ORM classes, relationships, and database infrastructure automatically. This process creates a complete backend data layer with engine setup and Declarative Base without manual coding.

Can I use SQLAlchemy models for both PostgreSQL production and SQLite testing environments?

Yes, SQLAlchemy models can support both PostgreSQL production and SQLite testing environments. The generated database infrastructure includes a core engine, SessionLocal, and Declarative Base configured to handle dual database environments seamlessly.

What is the best way to set up SQLAlchemy ORM relationships with cascade rules?

The best way to set up SQLAlchemy ORM relationships with cascade rules is to define them using explicit back_populates and ondelete cascade instructions. This ensures referential integrity is maintained when parent records are removed from the database.

How do I create Alembic-style migrations with SQLAlchemy?

To create Alembic-style migrations with SQLAlchemy, use an initialization workflow that generates table creation scripts and migration scaffolding. This prepares the database schema evolution process alongside the generated ORM models.

Does SQLAlchemy model generation support many-to-many relationships?

Yes, SQLAlchemy model generation supports many-to-many relationships alongside one-to-many associations. It automatically configures the necessary association tables and relationship attributes with explicit back_populates for bidirectional navigation.

How do I set up SQLite testing scaffolding for SQLAlchemy database models?

To set up SQLite testing scaffolding for SQLAlchemy database models, generate testing configurations with isolated schemas. This allows running database tests against an in-memory or local SQLite instance without affecting the production PostgreSQL environment.