๐ง "And what about drizzle?" ๐ง
Great question in the comments to the previous post
I even thought of making a post about Drizzle ORM as a follow-up to the previous one: "it's the second library we would have tried if we didn't have kysely"
Several things confuse me:
โ Drizzle is further from SQL than kysely: to get relations in Drizzle, you can use "with: { ... }", which doesn't exist in SQL, so it will be interpreted in its own way, while kysely only has SQL capabilities (e.g., join or json_agg), which are very well documented โ For kysely, it's enough to have type definitions (type, interface) for the database tables, which is super easy to do even with your own introspection tools (we had our own script, then switched to the official one, but will soon switch back), and it's also very easy to extend (import into a neighboring file, customize types, use custom types), while in Drizzle you'll have to use their introspection (which broke on our databases due to incomplete support for some types) + I still don't understand how to extend its introspection โ IMHO, kysely has more advanced documentation
But since kysely worked, I have no reason or advantage to even look at Drizzle, because kysely handles my main need โ having maximum type safety and flexibility in writing non-standard SQL queries โ much better (I'll show an example in the next post)