Fähigkeiten sqlmodel-crud
🗄️

sqlmodel-crud

Sicher 🌐 Netzwerkzugriff📁 Dateisystemzugriff⚙️ Externe Befehle🔑 Umgebungsvariablen

Create SQLModel database models and CRUD operations

Creating SQLModel database models requires understanding Pydantic integration, async sessions, and relationship configuration. This skill provides expert patterns for building type-safe database operations with proper validation.

Unterstützt: Claude Codex Code(CC)
📊 69 Angemessen
1

Die Skill-ZIP herunterladen

2

In Claude hochladen

Gehe zu Einstellungen → Fähigkeiten → Skills → Skill hochladen

3

Einschalten und loslegen

Teste es

Verwendung von "sqlmodel-crud". Create a Student model with name, email, and enrollment date fields

Erwartetes Ergebnis:

  • Created Student model with id (UUID primary key), name (2-100 chars required), email (unique index), enrollment_date (datetime), and timestamps
  • Added table=True for database table creation
  • Configured optional is_active field with default True
  • Ready to use with CRUD operations

Verwendung von "sqlmodel-crud". Build a query to find all students with pending fees in a class

Erwartetes Ergebnis:

  • Wrote subquery to find students with pending fee status
  • Used join with Student table filtered by class_id
  • Added pagination with offset and limit
  • Ordered results by student name alphabetically

Sicherheitsaudit

Sicher
v5 • 1/16/2026

Pure documentation skill containing guidance examples for SQLModel database operations. No executable code, no network calls, no filesystem access beyond reading the skill file itself. All static findings are false positives from the scanner misinterpreting markdown code blocks as shell commands and field names as cryptographic patterns.

2
Gescannte Dateien
878
Analysierte Zeilen
4
befunde
5
Gesamtzahl Audits
Auditiert von: claude Audit-Verlauf anzeigen →

Qualitätsbewertung

38
Architektur
100
Wartbarkeit
87
Inhalt
22
Community
100
Sicherheit
83
Spezifikationskonformität

Was du bauen kannst

Build type-safe FastAPI endpoints

Create SQLModel models and CRUD operations for FastAPI routes with proper Pydantic validation and async database sessions.

Design database schema

Design entities with relationships including one-to-many, many-to-many, and one-to-one patterns with proper foreign keys.

Write complex queries

Build advanced queries with joins, subqueries, aggregations, conditional logic, and pagination for reporting systems.

Probiere diese Prompts

Basic model
Create a SQLModel table=True model called Product with id, name, price, and description fields including proper validation constraints.
CRUD operations
Write async CRUD operations for a Product model including create, get_by_id, get_all with pagination, update, and delete methods using AsyncSession.
Relationships
Create SQLModel models for Order and OrderItem with one-to-many relationship including back_populates and proper foreign key configuration.
Complex queries
Write a query to get orders with their items using eager loading with selectinload, filtering by date range, and ordering by created_at descending.

Bewährte Verfahren

  • Use table=True for all database models and separate Pydantic models for request/response schemas
  • Add index=True on frequently filtered fields and unique=True on email and other business keys
  • Always use AsyncSession for async applications and handle transactions with commit/rollback

Vermeiden

  • Do not use from_attributes = True without understanding the security implications of mass assignment
  • Avoid mixing SQLModel and Pydantic models in the same class definition without proper separation
  • Do not skip adding created_at and updated_at timestamps for audit trails

Häufig gestellte Fragen

What Python versions are supported?
SQLModel requires Python 3.8 or later for production use.
What databases work with SQLModel?
SQLModel supports PostgreSQL, MySQL, SQLite, and other databases compatible with SQLAlchemy async drivers.
How do I integrate with FastAPI?
Use FastAPI Depends() to inject AsyncSession from a sessionmaker factory connected to your SQLModel engine.
Is my data safe with this skill?
Yes. This skill only provides guidance patterns. Data safety depends on your database configuration, connection security, and access controls.
Why are my queries slow?
Add index=True on filtered fields, use eager loading with selectinload for relationships, and avoid N+1 query patterns.
How does this compare to SQLAlchemy?
SQLModel is built on SQLAlchemy and Pydantic. It provides simpler syntax while maintaining full SQLAlchemy capability and type safety.