What problem does it solve?
Working with ORMs and databases can be complex, involving schema definitions, query writing, and migration management. This skill provides expert guidance and project conventions for Drizzle ORM, ensuring type-safe, efficient, and maintainable database operations within a Next.js project.
Core Features & Use Cases
- Schema Definition Guide: Comprehensive patterns for defining tables, columns, relations, and indexes with type safety.
- Data Access Patterns: Best practices for writing SELECT, INSERT, UPDATE, and DELETE queries, including joins and transactions.
- Migration Workflow: Explains the process for generating and applying database migrations, ensuring schema evolution is smooth.
- Use Case: You need to add a new
user_profiles table with a foreign key to users. Use this skill to define the schema correctly, including timestamps and indexes, and understand the migration steps.
Quick Start
Help me define a new 'user_profiles' table with a foreign key to the 'users' table.