Open SamyPesse opened 1 year ago
on insert, we are returning the same object that is returned from a driver. As long as mysql2
is different from database-js
it will have a different API for insert/update/delete data returned
But I agree that we need to unify those and return them all in 1 format. I'll mark this issue as improvement
This certainly tripped me up! Was also struggling to figure out why insertId
is typed as a string. Some small tweaks seem like they'd make drizzle + planetscale a bit more ergonomic.
Maybe I'll take a crack at it at some point if there is still interest, once I get frustrated enough with Number(insert.insertId)
I also found it interesting that only AUTO_INCREMENT
is supported. Not sure if that is the same behaviour as the other drivers or not
What version of
drizzle-orm
are you using?0.27.0
What version of
drizzle-kit
are you using?No response
Describe the Bug
The following code:
returns different
result
betweendrizzle-orm/mysql2
anddrizzle-orm/planetscale-serverless
.With
drizzle-orm/mysql2
,result
is an array and doesn't match the typescript definition:When using
drizzle-orm/planetscale-serverless
, accesingresult.insertId
works directly.Expected behavior
Both should return the same thing, probably
ExecutedQuery
orResultSetHeader
Environment & setup
No response