Skip to content
agents.store
devdevelopment

sqlalchemy-dev

SQLAlchemy dev plugin for Agents Store. Typed SQLAlchemy 2.0 style (Mapped, mapped_column, select) with a SQLAlchemy 2.1 section: model definition patterns, relationship mapping, query optimization, Alembic migrations, and troubleshooting.

v2.1.7Updated

  • sqlalchemy
  • dev
  • agents-store
  • python
  • orm
  • alembic
  • database

Install

Pick your agent for the steps.

Install on Claude Code

  1. 1.Add the marketplace

    /plugin marketplace add Agents-Store/claude-plugins
  2. 2.Install the plugin

    /plugin install sqlalchemy-dev@agents-store-claude-plugins

    Type it inside Claude Code.

Claude Code install docs

What is inside

Skills (6)

  • api-reference

    Use when the user asks for "SQLAlchemy API reference", "mapped_column options", "SQLAlchemy column types", "SQLAlchemy session methods", "db.session API", "SQLAlchemy relationship options", "lazy loading strategies", or needs specific SQLAlchemy framework API details.

  • cli-recipes

    Use when the user asks about "Alembic commands", "database migrations", "flask db migrate", "flask db upgrade", "create migration", "rollback migration", "alembic check", "SQLAlchemy CLI", or needs ready-to-use database migration commands.

  • model-patterns

    Use when the user asks about "SQLAlchemy models", "define database model", "Mapped and mapped_column", "DeclarativeBase", "SQLAlchemy relationships", "one-to-many relationship", "many-to-many", "SQLAlchemy column types", "model constraints", "Flask-SQLAlchemy model", "convert db.Column to Mapped 2.0 style", "upgrade to SQLAlchemy 2.1", "Flask-Login User model", "models owned by a user", or needs patterns for defining database models with SQLAlchemy.

  • query-patterns

    Use when the user asks about "SQLAlchemy queries", "filter records", "SQLAlchemy select", "session.scalars", "join tables", "aggregate query", "order by", "pagination", "N+1 query problem", "eager loading", "SQLAlchemy session", "bulk insert", "convert Model.query to select() 2.0 style", "upgrade to SQLAlchemy 2.1", "filter queries by current user", "owner-scoped queries", or needs patterns for querying data with SQLAlchemy.

  • setup

    Use when the user asks to "verify SQLAlchemy setup", "check database connection", "is SQLAlchemy configured correctly", "test database setup", "which SQLAlchemy version", "SQLAlchemy 2.1", or needs to confirm that SQLAlchemy is properly initialized in their Python project.

  • troubleshoot

    Use when the user encounters "SQLAlchemy errors", "database error", "OperationalError", "IntegrityError", "DetachedInstanceError", "AmbiguousColumnError", "LegacyAPIWarning", "No module named psycopg", "SQLAlchemy not working", "migration error", "debug SQLAlchemy", or needs to diagnose and fix common SQLAlchemy problems.

Agents (1)

  • sqlalchemy-developer

    Use this agent when the user needs help building with SQLAlchemy — defining models, writing queries, setting up migrations, debugging database errors, or optimizing query performance. <example> Context: User is defining a new database model user: "Help me create a model for tracking appointments with relationships to clients and users" assistant: "I'll use the sqlalchemy-developer agent to design the model with proper relationships." <commentary> Developer needs help defining SQLAlchemy models with foreign keys and relationships. </commentary> </example> <example> Context: User is debugging a database error user: "I'm getting an IntegrityError when trying to delete a client who has appointments" assistant: "I'll use the sqlalchemy-developer agent to diagnose the constraint error." <commentary> Developer has a foreign key constraint issue — agent can analyze the model relationships and fix it. </commentary> </example> <example> Context: User wants to optimize slow database queries user: "My appointments page loads slowly because it makes too many database queries" assistant: "I'll use the sqlalchemy-developer agent to identify and fix the N+1 query problem." <commentary> Developer needs query optimization — agent can add eager loading to fix N+1 issues. </commentary> </example>

README

SQLAlchemy dev plugin for Agents Store. Typed SQLAlchemy 2.0 style throughout (DeclarativeBase, Mapped, mapped_column, select()), with a SQLAlchemy 2.1 section: model definition patterns, relationship mapping, query optimization, Alembic migrations, and troubleshooting for developers building with SQLAlchemy 2.0 and 2.1.

Skills

SkillDescription
setupVerify SQLAlchemy configuration, version pin, driver and database connection
model-patternsModel definitions, relationships, column types, constraints, mixins; the Flask-Login User model and user-owned tables
query-patternsQueries, filtering, joins, aggregations, eager loading, pagination, bulk operations; owner-scoped (per-user) queries
api-referenceCore SQLAlchemy API (column types, session methods, relationship options), plus references: advanced API, SQLAlchemy 2.1, Legacy 1.x style
cli-recipesAlembic / Flask-Migrate migration commands
troubleshootCommon SQLAlchemy errors and diagnostic steps

Agent

sqlalchemy-developer — SQLAlchemy development specialist for defining models, writing queries, managing migrations, and debugging database issues.

Installation

Install via Agents Store or add manually to your Claude Code plugins.

Prerequisites

  • Python 3.11+ for SQLAlchemy 2.1 (SQLAlchemy 2.0.x runs on Python 3.7+; Alembic 1.20 needs 3.10+)
  • SQLAlchemy 2.1, or SQLAlchemy 2.0.x
  • Flask-SQLAlchemy 3.1 with "SQLAlchemy<2.1": a MappedAsDataclass base fails on SQLAlchemy 2.1 (pallets-eco/flask-sqlalchemy#1420; plain db.Model works), so pin SQLAlchemy<2.1 to be safe until Flask-SQLAlchemy supports 2.1:
pip install Flask-SQLAlchemy "SQLAlchemy<2.1" Flask-Migrate

Plain SQLAlchemy projects install 2.1 directly. For PostgreSQL name the driver in the URL (postgresql+psycopg://) and install "psycopg[binary]"; for asyncio install "sqlalchemy[asyncio]".

The examples use the 2.0 typed style and Python 3.10+ syntax. Code written in the SQLAlchemy 1.x style (Column, backref, Model.query) is covered only as a translation aid in the Legacy 1.x style reference.