with one click
drizzle-knowledge-patch
Drizzle ORM
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Drizzle ORM
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | drizzle-knowledge-patch |
| description | Drizzle ORM |
| license | MIT |
| version | 1.0.0-beta.19 |
| metadata | {"author":"Nevaberry"} |
Use this patch when changing Drizzle queries, schema-derived validation, or Drizzle Kit execution.
Before editing:
drizzle-orm and drizzle-kit package versions.drizzle-zod.sql.identifier() or sql.as().Keep package versions distinct while reasoning:
drizzle-orm controls query helpers and built-in Zod generators.drizzle-kit controls CLI module loading.zod remains a direct application dependency for generated schemas.Do not infer one package's behavior from another package's version.
| Reference | Topics | Read when |
|---|---|---|
| queries-and-runtime.md | SQL identifier and alias escaping; security review | Building dynamic SQL or auditing sql.identifier() and sql.as() |
| migrations-and-kit.md | Runtime-aware CLI loading; ESM and CommonJS projects | Running Drizzle Kit or diagnosing module-loading failures |
| schema-validation.md | Built-in Zod entry point; deprecated package; select, insert, and update schemas | Generating or migrating schema-derived validation |
Treat dynamic identifier and alias construction as security-sensitive.
Current releases properly escape values passed to:
sql.identifier()sql.as()Earlier releases could leave those values improperly escaped and expose applications to SQL injection.
Upgrade when either helper is used.
Then audit every call site that accepts a value originating outside the static query definition.
Read queries-and-runtime.md for the security boundary and review checklist.
drizzle-zod entry pointFor drizzle-orm@1.0.0-beta.15 and newer, import schema generators from
drizzle-orm/zod.
Install zod directly.
Do not expect new updates to the separate drizzle-zod package.
Use the built-in generators for all three supported schema purposes:
import {
createInsertSchema,
createSelectSchema,
createUpdateSchema,
} from 'drizzle-orm/zod';
const selectUserSchema = createSelectSchema(users);
const insertUserSchema = createInsertSchema(users);
const updateUserSchema = createUpdateSchema(users);
Read schema-validation.md before changing dependencies or imports.
Starting with drizzle-kit@0.31.10, a Node launch uses the tsx loader
instead of esbuild-register.
This lets the CLI load both ESM and CommonJS projects.
Bun and Deno launches do not use that Node loader path.
They use their native import systems instead.
Read migrations-and-kit.md before changing loader dependencies or debugging module format errors.
When a task touches dynamic SQL:
sql.identifier( and .as( usages.Do not claim that application-side validation replaces correct escaping.
Do not preserve an affected release merely because common values appear to work.
Use the exact helper names in review notes so the affected surface is easy to find.
When a project uses Drizzle-derived Zod schemas:
zod as a direct dependency if it is not already direct.drizzle-zod with drizzle-orm/zod.createSelectSchema().createInsertSchema().createUpdateSchema().drizzle-zod only after no imports still depend on it.Keep the migration narrow.
The entry-point change does not require renaming the three generator functions shown above.
Do not add a second compatibility wrapper unless the repository must support an older ORM that lacks the built-in entry point.
If old and new package support must coexist, state that constraint before selecting an import strategy.
When the CLI cannot load project configuration or source modules:
drizzle-kit version.tsx loader path.Do not prescribe esbuild-register for the current Node loading path.
Do not add tsx solely to control a Bun or Deno launch that bypasses it.
Distinguish a package-format problem from a launch-runtime mismatch in the final diagnosis.
Before completing a Drizzle change, verify the relevant items.
sql.identifier() is used.sql.as() is used.drizzle-orm/zod where supported.zod as a direct dependency.drizzle-zod.tsx, not esbuild-register, on the current Node path.State which package and runtime controlled the behavior you changed.
Mention any required minimum package version only where the code depends on that threshold.
For security-sensitive helper usage, explicitly recommend the corrected release rather than presenting the upgrade as optional cleanup.
For Zod migration work, report both the import change and the direct
zod dependency.
For CLI work, report whether the tested path used Node's loader or a runtime-native import system.
AlmaLinux
Angular
Arch Linux
Astro
Auth.js
AWS SDK