sqlmodel-crud
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.
Die Skill-ZIP herunterladen
In Claude hochladen
Gehe zu Einstellungen → Fähigkeiten → Skills → Skill hochladen
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
SicherPure 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.
Risikofaktoren
🌐 Netzwerkzugriff (6)
📁 Dateisystemzugriff (1)
⚙️ Externe Befehle (65)
🔑 Umgebungsvariablen (5)
Qualitätsbewertung
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
Create a SQLModel table=True model called Product with id, name, price, and description fields including proper validation constraints.
Write async CRUD operations for a Product model including create, get_by_id, get_all with pagination, update, and delete methods using AsyncSession.
Create SQLModel models for Order and OrderItem with one-to-many relationship including back_populates and proper foreign key configuration.
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