My goal is to support both the node-postgres and neon-http drivers. My db object is therefore defined as a union type of the two drivers.
This gives a Typescript error when using the partial insert returning (https://orm.drizzle.team/docs/insert#insert-returning). All of a sudden, it's not expecting a parameter, even though it's supported by both drivers (they're both PostgreSQL).
No Typescript errors should occur on functionality supported by both database types.
Environment & setup
Both on Webstorm and Visual Studio Code, not that it matters all that much.
You can also test it out bare bones by running npm run check-types (tsc --noEmit) and see where it fails.
What version of
drizzle-orm
are you using?0.35.3
What version of
drizzle-kit
are you using?No response
Describe the Bug
My goal is to support both the
node-postgres
andneon-http
drivers. Mydb
object is therefore defined as a union type of the two drivers.This gives a Typescript error when using the partial insert returning (https://orm.drizzle.team/docs/insert#insert-returning). All of a sudden, it's not expecting a parameter, even though it's supported by both drivers (they're both PostgreSQL).
Small repo to reproduce the issue: https://github.com/JakobLierman/drizzle-union-type-bug.
Expected behavior
No Typescript errors should occur on functionality supported by both database types.
Environment & setup
Both on Webstorm and Visual Studio Code, not that it matters all that much. You can also test it out bare bones by running
npm run check-types
(tsc --noEmit
) and see where it fails.