[BUG]: tables passed in delete / insert / update
are not type-checked even if schema
is passed in drizzle
constructor.
#2283
Labels
bug
Something isn't working
What version of
drizzle-orm
are you using?0.30.8
What version of
drizzle-kit
are you using?0.20.14
Describe the Bug
(I've filed a bug report but arguably this could be considered as a missing feature).
Unless I'm missing something, the tables passed in
insert
,delete
orupdate
are not type-checked based on the tables (schemas) given in thedrizzle
constructor, at least when using Postgres (not tested with other DBs).To reproduce, create two tables, used in two different databases.
Expected behavior
dbB.insert(tableA).values({columnA: 'value'}).execute()
should have a type error, and same forupdate
anddelete
.Note
As a workaround for now, I've modified the database typing and exported a new one that have the typings for
insert
,delete
andupdate
scoped to the relevant tables. For instance, fordbA
The text was updated successfully, but these errors were encountered: