How does it differ from Knex.js? #530
Replies: 2 comments
-
Have never used Knex.js, but as i check the Knex TS docs, the Typescript Support for Knex.js seems kinda limited. For now both things are very new to me so i can only say the different here is Zod. It seems Knex have you define the type of the data result from queries by yourself, which kinda like Mongoose for me, while Drizzle help you type it through Zod validation schema. |
Beta Was this translation helpful? Give feedback.
-
Knex isn't DRY, means you have to repeat schema (for the db) and type definitions (for Typscript). With Drizzle you define once and have the schema and type definitions in one source of truth => less work and less error-prone. Also Knex is fully written in JS, is from a time before TS. |
Beta Was this translation helpful? Give feedback.
-
I'm genuinely curious, as I've heard many good things about Drizzle.
By looking at the documentation of Drizzle, and having used Knex for many years, they seem extremely similar. The only difference I have noticed is that Drizzle seems to have a slightly bigger emphasis on Typescript.
The way you define a schema and the query syntax is very similar in both libraries.
Knex doesn't fancy itself as an ORM, but Drizzle seems just as minimalist
Can anyone point to me the main differences between the two libs? 😊
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions