Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Drizzle ORM patterns for PostgreSQL.
.claude/skills/aiskillstore-drizzle-patterns/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 1% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 74% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 40% | 0% |
| case-20 | ✓→✓ | = Same ✓ | 48% | 0% |
| case-03 | ✓→✓ | = Same ✓ | -7% | 0% |
typescript// db/schema/users.ts import { pgTable, uuid, varchar, timestamp, boolean } from 'drizzle-orm/pg-core'; export const users = pgTable('users', { id: uuid('id').primaryKey().defaultRandom(), email: varchar('email', { length: 255 }).notNull().unique(), name: varchar('name', { length: 255 }), emailVerified: boolean('email_verified').default(false), createdAt: timestamp('created_at').defaultNow().notNull(), updatedAt: timestamp('updated_at').defaultNow().notNull(), }); export type User = typeof users.$inferSelect; export type NewUser = typeof users.$inferInsert;
typescript// db/schema/relations.ts import { relations } from 'drizzle-orm'; import { users } from './users'; import { posts } from './posts'; export const usersRelations = relations(users, ({ many }) => ({ posts: many(posts), })); export const postsRelations = relations(posts, ({ one }) => ({ author: one(users, { fields: [posts.authorId], references: [users.id], }), }));
typescript// db/index.ts import { drizzle } from 'drizzle-orm/node-postgres'; import { Pool } from 'pg'; import * as schema from './schema'; const pool = new Pool({ connectionString: process.env.DATABASE_URL, }); export const db = drizzle(pool, { schema });
typescriptimport { eq, and, or, like, desc, asc } from 'drizzle-orm'; // Find one const user = await db.query.users.findFirst({ where: eq(users.id, userId), }); // Find many with relations const usersWithPosts = await db.query.users.findMany({ with: { posts: true }, where: eq(users.emailVerified, true), orderBy: [desc(users.createdAt)], limit: 10, }); // Complex where const results = await db.query.posts.findMany({ where: and( eq(posts.published, true), or( like(posts.title, '%search%'), like(posts.content, '%search%') ) ), });
typescript// Insert const [newUser] = await db.insert(users).values({ email: 'test@example.com', name: 'Test User', }).returning(); // Insert many await db.insert(users).values([ { email: 'user1@example.com', name: 'User 1' }, { email: 'user2@example.com', name: 'User 2' }, ]); // Update await db.update(users) .set({ name: 'New Name', updatedAt: new Date() }) .where(eq(users.id, userId)); // Delete await db.delete(users) .where(eq(users.id, userId));
typescriptawait db.transaction(async (tx) => { const [user] = await tx.insert(users).values(userData).returning(); await tx.insert(profiles).values({ userId: user.id, ...profileData }); await tx.insert(settings).values({ userId: user.id, ...defaultSettings }); });
bash# Generate migration pnpm drizzle-kit generate # Push to database pnpm drizzle-kit push # Open Drizzle Studio pnpm drizzle-kit studio
typescriptimport { defineConfig } from 'drizzle-kit'; export default defineConfig({ schema: './db/schema/index.ts', out: './db/migrations', dialect: 'postgresql', dbCredentials: { url: process.env.DATABASE_URL!, }, });
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-20 | pass→pass | 9,255 | 6,857 | -26% | 1 | 1 | 0% | 1,571 | 2,323 | +48% | 0 | 0 | — |
case-01 | fail→pass | 13,942 | 13,307 | -5% | 1 | 1 | 0% | 2,813 | 2,840 | +1% | 0 | 0 | — |
case-02 | fail→fail | 12,515 | 12,973 | +4% | 1 | 1 | 0% | 2,215 | 2,552 | +15% | 0 | 0 | — |
case-03 | pass→pass | 14,190 | 6,150 | -57% | 1 | 1 | 0% | 1,732 | 1,605 | -7% | 0 | 0 | — |
case-04 | pass→pass | 7,371 | 9,132 | +24% | 1 | 1 | 0% | 1,467 | 1,748 | +19% | 0 | 0 | — |
case-05 | pass→pass | 6,586 | 3,643 | -45% | 1 | 1 | 0% | 1,244 | 1,572 | +26% | 0 | 0 | — |
case-06 | pass→pass | 15,642 | 10,422 | -33% | 1 | 1 | 0% | 1,754 | 1,928 | +10% | 0 | 0 | — |
case-07 | pass→pass | 15,375 | 4,771 | -69% | 1 | 1 | 0% | 2,020 | 1,744 | -14% | 0 | 0 | — |
case-08 | pass→pass | 12,226 | 13,134 | +7% | 1 | 1 | 0% | 1,302 | 2,024 | +55% | 0 | 0 | — |
case-09 | pass→pass | 15,400 | 5,795 | -62% | 1 | 1 | 0% | 1,922 | 2,023 | +5% | 0 | 0 | — |
case-10 | pass→pass | 14,583 | 8,852 | -39% | 1 | 1 | 0% | 1,300 | 1,686 | +30% | 0 | 0 | — |
case-11 | fail→pass | 5,149 | 8,922 | +73% | 1 | 1 | 0% | 923 | 1,605 | +74% | 0 | 0 | — |
case-12 | pass→pass | 10,386 | 6,138 | -41% | 1 | 1 | 0% | 1,731 | 2,107 | +22% | 0 | 0 | — |
case-13 | pass→pass | 8,800 | 10,732 | +22% | 1 | 1 | 0% | 1,570 | 1,909 | +22% | 0 | 0 | — |
case-14 | pass→pass | 14,562 | 12,416 | -15% | 1 | 1 | 0% | 1,764 | 2,334 | +32% | 0 | 0 | — |
case-15 | fail→pass | 13,504 | 7,770 | -42% | 1 | 1 | 0% | 1,048 | 1,471 | +40% | 0 | 0 | — |
case-16 | pass→pass | 4,620 | 5,361 | +16% | 1 | 1 | 0% | 676 | 1,405 | +108% | 0 | 0 | — |
case-17 | pass→pass | 16,187 | 14,304 | -12% | 1 | 1 | 0% | 2,350 | 2,915 | +24% | 0 | 0 | — |
case-18 | pass→pass | 3,431 | 1,997 | -42% | 1 | 1 | 0% | 402 | 1,224 | +204% | 0 | 0 | — |
case-19 | pass→pass | 9,514 | 3,200 | -66% | 1 | 1 | 0% | 624 | 1,295 | +108% | 0 | 0 | — |
case-21 | pass→pass | 21,465 | 15,379 | -28% | 1 | 1 | 0% | 2,754 | 2,765 | +0% | 0 | 0 | — |
case-22 | pass→pass | 9,833 | 12,123 | +23% | 1 | 1 | 0% | 2,010 | 2,163 | +8% | 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. 22 cases were attempted. The headline lift of +14 percentage points is the difference between those two pass rates over the 22 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.