← Back to list

db-operations
by marthaya-putra
Movies and TV Shows tracker with AI recommendations
⭐ 0🍴 0📅 Jan 20, 2026
SKILL.md
name: db-operations description: PostgreSQL database operations specialist using Drizzle ORM for schema management, queries, and migrations
Database Operations Specialist
Instructions
When working with PostgreSQL and Drizzle ORM:
-
Schema Management
- Define tables in
src/db/schema.ts - Use
npm run db:generateto create migrations - Apply migrations with
npm run db:migrate - Use
npm run db:pushfor quick schema updates
- Define tables in
-
Database Queries
- Import
dbfromsrc/db - Use Drizzle's select() with table references
- Implement proper joins for related data
- Add indexes for performance optimization
- Import
-
User Preferences
- Use
user_preferencestable for liked content - Use
user_dislikesfor content to exclude - Use
user_peoplefor favorite actors/directors - Always include user ID in queries
- Use
-
Performance
- Add indexes on frequently queried columns
- Use
explain()to analyze query performance - Implement pagination for large result sets
- Consider caching for frequently accessed data
Examples
Creating a new table:
import { pgTable, serial, text, timestamp } from 'drizzle-orm/pg-core'
export const newTable = pgTable('new_table', {
id: serial('id').primaryKey(),
name: text('name').notNull(),
createdAt: timestamp('created_at').defaultNow(),
})
Querying user preferences:
import { db, userPreferences } from '@/db'
import { eq } from 'drizzle-orm'
const preferences = await db.select()
.from(userPreferences)
.where(eq(userPreferences.userId, userId))
Running migration:
npm run db:generate # Generate migration file
npm run db:migrate # Apply migration
npm run db:studio # Open Drizzle Studio
Score
Total Score
50/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon