sqlalchemy

Guide SQLAlchemy ORM modeling, connections, and CRUD operations in Python.

Updated Mar 9, 2026
One-click install
npx skills add https://github.com/bswrundquist/devtools --skill sqlalchemy-bswrundquist
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sqlalchemy
Source: https://github.com/bswrundquist/devtools/tree/main/src/devtools/templates/claude/user/.claude/skills/sqlalchemy
Command: npx skills add https://github.com/bswrundquist/devtools --skill sqlalchemy-bswrundquist

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of defining, connecting to, and interacting with relational databases using SQLAlchemy, ensuring consistent and maintainable code.

Core Features & Use Cases

  • Model Definition: Create Pythonic models with clear naming conventions for tables, columns, and relationships.
  • Database Connection: Set up synchronous and asynchronous connections to various databases.
  • CRUD Operations: Perform Create, Read, Update, and Delete operations efficiently.
  • Advanced Queries: Build complex queries with filtering, joins, and aggregations.
  • Migrations: Integrate with Alembic for robust database schema management.
  • Use Case: Define SQLAlchemy models for a web application's user and product data, set up a PostgreSQL connection, and implement CRUD operations for managing these entities.

Quick Start

Use the sqlalchemy skill to create a basic User model with an ID and username.

Frequently Asked Questions about sqlalchemy

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

FAQPage Schema
How do I define SQLAlchemy ORM models for a Python application?

SQLAlchemy ORM models are defined by creating Pythonic classes that map to database tables, specifying clear naming conventions for tables, columns, and relationships to structure your relational data.

Can I use asynchronous database connections with SQLAlchemy?

Yes, SQLAlchemy supports asynchronous database connections, allowing you to set up async database interaction patterns alongside standard synchronous connections within your Python applications.

What is the best way to manage database schema migrations with SQLAlchemy?

The best way to manage database schema migrations with SQLAlchemy is by integrating Alembic, which provides robust schema versioning and management for relational databases.

How do I build advanced queries with joins and aggregations in SQLAlchemy?

Advanced SQLAlchemy queries are built using ORM methods to construct complex filtering, joins, and aggregations, enabling efficient Read operations for relational database management.

Does SQLAlchemy ORM integrate with Pydantic for web application data validation?

Yes, SQLAlchemy ORM provides integration patterns with Pydantic, streamlining data validation and serialization when defining models for web application user and product data.

What are common pitfalls when performing CRUD operations in SQLAlchemy?

Common SQLAlchemy CRUD pitfalls involve inefficient session management and query structuring, which can be avoided by following best practices for robust database interaction and transaction handling.