litestar-databases

Build Litestar database architectures with SQLAlchemy and Piccolo ORMs.

7|1|Updated Mar 2, 2026
One-click install
npx skills add https://github.com/alti3/litestar-skills --skill litestar-databases
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: litestar-databases
Source: https://github.com/alti3/litestar-skills/tree/main/plugins/litestar/skills/litestar-databases
Command: npx skills add https://github.com/alti3/litestar-skills --skill litestar-databases

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Build robust Litestar database architectures using SQLAlchemy and Piccolo ORM, including model and repository patterns, plugin selection, session lifecycle management, transaction boundaries, and DTO/serialization boundaries. Use this skill when implementing persistence layers, transaction handling, or ORM integration. Do not use for non-persistent in-memory workflows.

Core Features & Use Cases

  • Model/repository patterns for SQLAlchemy and Piccolo integration
  • Guidance on ORM plugin configuration (combined vs split) and lifecycle management
  • DTO/serialization boundaries to protect private fields and define clean API surfaces
  • Per-request session ownership and deterministic transaction boundaries across handlers

Quick Start

Set up a Litestar app with the SQLAlchemy or Piccolo path, configure a central async session, and expose a DTO-backed API.

Frequently Asked Questions about litestar-databases

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

FAQPage Schema
How do I manage SQLAlchemy session lifecycle and transaction boundaries in a Litestar API?

Managing SQLAlchemy session lifecycle in Litestar requires explicit per-request session ownership to ensure deterministic transaction boundaries across API handlers. This approach guarantees that each request receives a central async session that closes predictably after the transaction completes.

Should I use combined or split SQLAlchemy plugin configurations in Litestar?

Choosing combined or split SQLAlchemy plugin configurations in Litestar depends on your application's modular structure. Combined setups consolidate database initialization, while split configurations separate read and write paths, allowing tailored lifecycle management for distinct server API components.

How do I use DTOs to shield internal ORM details during Litestar serialization?

Using DTOs to shield internal ORM details during Litestar serialization involves defining DTO-based serialization controls that protect private fields. This establishes a clean API surface by preventing direct exposure of internal SQLAlchemy or Piccolo model structures to clients.

Can I use the Piccolo ORM with Litestar for model and repository patterns?

Yes, you can use the Piccolo ORM with Litestar to implement model and repository patterns. This integration supports building robust database architectures by structuring data access logic through repositories, ensuring consistent data operations across server APIs.

When should I not use a Litestar ORM database integration skill?

You should not use a Litestar ORM database integration skill for non-persistent in-memory workflows. It is designed strictly for implementing persistence layers, handling transaction management, and configuring ORM integrations requiring durable storage.