# database-skill - Author: naveed569 - Repository: umairrafeeq303-create/hackathon-II-phase-three - Version: 20260208222912 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-08 - Source: https://github.com/umairrafeeq303-create/hackathon-II-phase-three - Web: https://mule.run/skillshub/@@umairrafeeq303-create/hackathon-II-phase-three~database-skill:20260208222912 --- # Database Agent Skills ## 1. SQLModel ORM - Model definition with SQLModel - Field types and constraints - Relationships (ForeignKey) - Table inheritance - Optional fields ## 2. PostgreSQL with psycopg2 - Async database driver - Connection string format - Connection pooling - Transaction management ## 3. Database Engine Setup - create_async_engine from SQLModel - Engine configuration - Session management - Dependency injection for sessions ## 4. Schema Design - Primary keys (UUID, Integer) - Foreign keys and relationships - Indexes for performance - Constraints (unique, not null) - Default values ## 5. Migrations (Optional) - Alembic setup - Migration scripts - Schema versioning - Rollback support ## 6. CRUD Operations - Select queries with filtering - Insert operations - Update operations - Delete operations - Bulk operations ## 7. Query Optimization - Proper indexing - Query filtering - Pagination - Sorting ## 8. Error Handling - Database connection errors - Constraint violation errors - Foreign key errors - Transaction rollback