[BUG]: $returningId returns an empty array unless primaryKey() is put directly on the column #4302
Open
1 task done
Labels
bug
Something isn't working
Report hasn't been filed before.
What version of
drizzle-orm
are you using?0.40.1
What version of
drizzle-kit
are you using?0.30.5
Other packages
No response
Describe the Bug
DB: mysql
orm: 0.40.1
kit: 0.30.5
$returningId() should return the inserted row's ID, but it returns an empty array unless primaryKey() is added to the column directly, instead of in the callback.
The following works fine.
This does not work
Not a huge problem, just add primaryKey to the column right? Well, not if you constantly pull the schema from the DB. The generated schema will not add primaryKey to the column directly, only in the callback function, so you have to manually add it to all columns every time you pull the schema.
The text was updated successfully, but these errors were encountered: