Build type-safe database queries with Drizzle ORM patterns.
$inferSelect for query return types, $inferInsert for insert input — they differ (select has defaults filled, insert has optionals)relations() in a separate call, not inline with table — Drizzle separates schema from relationswhere: eq(users.id, 5) not where: { id: 5 } — Prisma syntax doesn\'t workand() / or(): INLINECODE7with:, db.select().from(users) for SQL-like — mixing them causes type errorsdrizzle-kit push is dev-only (destructive) — production needs drizzle-kit generate then INLINECODE13strict: true in drizzle.config.ts to catch schema drift before it hits productionpgTable, imports from INLINECODE16mysqlTable, imports from INLINECODE18sqliteTable, imports from INLINECODE20db.transaction(async (tx) => {}) — Drizzle doesn\'t auto-batch.prepare() for queries executed repeatedly — skips query building overhead.limit() to every findMany() / select() — no default limit means full table scansawait on queries returns a Promise, not results — TypeScript doesn\'t catch this if you ignore the return{ rowCount } onlyjsonb(), MySQL uses json() — wrong function = wrong serialization该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 drizzle-1776420002 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 drizzle-1776420002 技能
skillhub install drizzle-1776420002
文件大小: 1.69 KB | 发布时间: 2026-4-17 20:22