You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When exactOptionalPropertyTypes is set in tsconfig, passing undefined to an optional property that does not explicitly allow undefined now becomes a type error.
Drizzle currently treats unset properties and properties with undefined keys the same in e.g. value objects, but the generated type for the argument to e.g. a .values() or a .set() only allows unset types, not optional ones.
Describe what you want
When
exactOptionalPropertyTypes
is set in tsconfig, passingundefined
to an optional property that does not explicitly allow undefined now becomes a type error.Drizzle currently treats unset properties and properties with undefined keys the same in e.g. value objects, but the generated type for the argument to e.g. a
.values()
or a.set()
only allows unset types, not optional ones.Having looked at only the postgres core, I believe that
.set()
can be resolve by marking the optional properties as allowing undefined as well in https://github.com/drizzle-team/drizzle-orm/blob/main/drizzle-orm/src/pg-core/query-builders/update.ts#L32and that
.values()
can be resolved by marking optional properties as allowing undefined as well in https://github.com/drizzle-team/drizzle-orm/blob/main/drizzle-orm/src/table.ts#L175The text was updated successfully, but these errors were encountered: