sqlalchemy

Manage PostgreSQL database interactions with SQLAlchemy 2.x ORM models and queries.

80|8|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/boludo00/bookkeep --skill sqlalchemy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sqlalchemy
Source: https://github.com/boludo00/bookkeep/tree/main/.claude/skills/sqlalchemy
Command: npx skills add https://github.com/boludo00/bookkeep --skill sqlalchemy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill simplifies the process of interacting with your PostgreSQL database by providing tools to define models, write efficient queries, and manage database operations within the Bookkeep backend.

Core Features & Use Cases

  • Model Definition: Create and manage SQLAlchemy ORM models for your database tables.
  • Query Optimization: Write efficient queries with eager loading and filtering.
  • Session Management: Handle database sessions effectively using FastAPI dependency injection.
  • Use Case: When you need to add a new feature that requires storing new types of data, use this Skill to define the corresponding SQLAlchemy model and integrate it into your API.

Quick Start

Define a new Book model in backend/app/models.py with title, author, and publication_year fields.

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 PostgreSQL database?

To define SQLAlchemy models, you create Python classes representing database tables with mapped columns and relationships. This Skill handles model definition for PostgreSQL and SQLite, allowing you to structure data storage and manage schemas efficiently.

What's the best way to manage database sessions with FastAPI dependency injection?

Managing database sessions with FastAPI dependency injection involves injecting synchronous SQLAlchemy sessions into route functions. This Skill supports effective session handling and lifecycle management, ensuring database connections are properly opened and closed per request.

How do I optimize SQLAlchemy queries with eager loading in a Python backend?

Optimizing SQLAlchemy queries with eager loading fetches related objects in a single query to prevent N+1 problems. This Skill facilitates query optimization by supporting eager loading and filtering when retrieving related ORM data.

Does this SQLAlchemy ORM approach work with both PostgreSQL and SQLite?

Yes, this SQLAlchemy ORM approach works with both PostgreSQL and SQLite. The Skill manages database interactions synchronously, supporting seamless transitions between different database backends within your FastAPI application architecture.

How do I perform CRUD operations using SQLAlchemy 2.x in a Python backend?

Performing CRUD operations using SQLAlchemy 2.x involves using ORM queries and synchronous sessions to create, read, update, and delete records. This Skill facilitates these operations and handles session management for your backend application.

Why use synchronous SQLAlchemy sessions instead of async for FastAPI?

Using synchronous SQLAlchemy sessions instead of async ensures compatibility with specific ORM features and existing codebases. This Skill supports synchronous sessions with FastAPI dependency injection to manage database operations stably.