Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Drizzle ORM patterns and migration safety rules. Use when defining schemas, running migrations, or debugging database issues. Triggers on: Drizzle, schema, migration, db:push, $inferSelect, array column.
.claude/skills/aiskillstore-pitfalls-drizzle-orm/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-11 | ✗→✓ | ▲ Improved | -70% | 0% |
| case-17 | ✗→✓ | ▲ Improved | -14% | 0% |
| case-24 | ✗→✓ | ▲ Improved | -10% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 8% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 20% | 0% |
Common pitfalls and correct patterns for Drizzle ORM.
Check that types are exported correctly.
Verify array columns use correct syntax.
Never change primary key types in production.
typescript// ❌ NEVER change primary key types // serial → varchar or varchar → uuid BREAKS migrations // ✅ Array columns - correct syntax allowedTokens: text('allowed_tokens').array() // CORRECT // ❌ WRONG: array(text('allowed_tokens')) // ✅ Always create insert/select types export type Strategy = typeof strategies.$inferSelect; export type NewStrategy = typeof strategies.$inferInsert; // ✅ Use drizzle-zod for validation import { createInsertSchema } from 'drizzle-zod'; export const insertStrategySchema = createInsertSchema(strategies);
bash# Safe schema sync npm run db:push # If data-loss warning and you're sure npm run db:push --force # NEVER in production without backup
typescript// ✅ Infer types from schema import { strategies } from './schema'; type Strategy = typeof strategies.$inferSelect; type NewStrategy = typeof strategies.$inferInsert; // ✅ With Zod validation import { createInsertSchema, createSelectSchema } from 'drizzle-zod'; import { z } from 'zod'; const insertSchema = createInsertSchema(strategies); type StrategyInput = z.infer<typeof insertSchema>;
text().array() syntax| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 17,738 | 14,304 | -19% | 1 | 1 | 0% | 2,751 | 2,095 | -24% | 0 | 0 | — |
case-02 | pass→pass | 7,684 | 5,609 | -27% | 1 | 1 | 0% | 1,413 | 1,527 | +8% | 0 | 0 | — |
case-03 | pass→pass | 6,115 | 4,485 | -27% | 1 | 1 | 0% | 1,079 | 1,294 | +20% | 0 | 0 | — |
case-04 | pass→pass | 8,812 | 7,984 | -9% | 1 | 1 | 0% | 587 | 879 | +50% | 0 | 0 | — |
case-05 | pass→pass | 18,758 | 13,613 | -27% | 1 | 1 | 0% | 2,406 | 1,946 | -19% | 0 | 0 | — |
case-06 | pass→pass | 15,039 | 12,792 | -15% | 1 | 1 | 0% | 2,475 | 1,699 | -31% | 0 | 0 | — |
case-07 | pass→pass | 5,357 | 8,631 | +61% | 1 | 1 | 0% | 941 | 1,035 | +10% | 0 | 0 | — |
case-08 | pass→pass | 4,378 | 6,792 | +55% | 1 | 1 | 0% | 746 | 755 | +1% | 0 | 0 | — |
case-09 | pass→pass | 12,024 | 6,223 | -48% | 1 | 1 | 0% | 1,358 | 1,535 | +13% | 0 | 0 | — |
case-10 | pass→pass | 7,822 | 10,113 | +29% | 1 | 1 | 0% | 1,454 | 1,379 | -5% | 0 | 0 | — |
case-11 | fail→pass | 23,447 | 8,327 | -64% | 1 | 1 | 0% | 3,327 | 985 | -70% | 0 | 0 | — |
case-12 | pass→pass | 9,651 | 3,056 | -68% | 1 | 1 | 0% | 669 | 970 | +45% | 0 | 0 | — |
case-13 | pass→pass | 20,434 | 7,973 | -61% | 1 | 1 | 0% | 2,655 | 1,762 | -34% | 0 | 0 | — |
case-14 | pass→pass | 11,366 | 8,107 | -29% | 1 | 1 | 0% | 1,145 | 980 | -14% | 0 | 0 | — |
case-15 | pass→pass | 9,759 | 3,243 | -67% | 1 | 1 | 0% | 875 | 982 | +12% | 0 | 0 | — |
case-16 | pass→pass | 16,727 | 7,093 | -58% | 1 | 1 | 0% | 1,960 | 1,723 | -12% | 0 | 0 | — |
case-17 | fail→pass | 18,816 | 12,660 | -33% | 1 | 1 | 0% | 3,085 | 2,655 | -14% | 0 | 0 | — |
case-18 | fail→fail | 9,911 | 2,119 | -79% | 1 | 1 | 0% | 783 | 792 | +1% | 0 | 0 | — |
case-19 | pass→pass | 9,472 | 4,597 | -51% | 1 | 1 | 0% | 1,725 | 1,298 | -25% | 0 | 0 | — |
case-20 | pass→pass | 10,896 | 11,628 | +7% | 1 | 1 | 0% | 1,831 | 1,690 | -8% | 0 | 0 | — |
case-21 | pass→pass | 8,745 | 4,488 | -49% | 1 | 1 | 0% | 1,276 | 1,292 | +1% | 0 | 0 | — |
case-22 | pass→pass | 15,556 | 12,434 | -20% | 1 | 1 | 0% | 1,875 | 1,860 | -1% | 0 | 0 | — |
case-23 | pass→pass | 11,782 | 8,629 | -27% | 1 | 1 | 0% | 1,198 | 1,147 | -4% | 0 | 0 | — |
case-24 | fail→pass | 14,124 | 5,661 | -60% | 1 | 1 | 0% | 1,524 | 1,364 | -10% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted. The headline lift of +13 percentage points is the difference between those two pass rates over the 24 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.