Replies: 1 comment
-
|
The confusion is completely understandable — both syntaxes are valid, but they belong to different major versions of drizzle-orm.
So which one to use depends on your installed version: # Check your current version
cat node_modules/drizzle-orm/package.json | grep '"version"'
The v2 API is a real improvement over v1 — it supports native many-to-many via If you're already on v1 and want to migrate, the team has a step-by-step guide: orm.drizzle.team/docs/relations-v1-v2. Migration is designed to be incremental, not a big-bang rewrite. The docs versioning isn't called out prominently enough, which is why this trips people up. Hopefully this clears it up! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm new to drizzle but have been struggling with it for a little while now.
The most confusing and time wasting aspect for me is the different versions. Not that you shouldn't have different versions but that your pages do not state which version they are for!
My current area of challenge is relations. Some pages show relations() and others show defineRelations(). Presumably you will know that this is the tip of the iceberg and there are inconsistencies however knowing which version would be a first step.
Beta Was this translation helpful? Give feedback.
All reactions