Bertrand
DTDrizzle Team
•Created by Bertrand on 11/1/2024 in #help
Is there a type for a Drizzle connection?
My use case is the following: I'm building a library dealing with a Neon database, but the connection shoud be created by the app using the library. So, all the functions of the lib expects as a their first parameter the actual connection to the database.
How can I type this parameter so that the function accepts both a connection created with the Neon HTTP and Websockets drivers?
Neon HTTP driver
Neon Websockets driver
I tried the following but it leads to a typescript error which I issued (https://github.com/drizzle-team/drizzle-orm/issues/3334) :
Many thanks in advance!
5 replies