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
Configuring the Neon serverless driver (v0.9.0) with Drizzle ORM using the following code:
import{neon}from"@neondatabase/serverless"import{drizzle}from"drizzle-orm/neon-http"constsql=neon(process.env.DATABASE_URL!)exportconstdb=drizzle(sql)// Error on this line
Produces this error:
Argument of type 'NeonQueryFunction<false, false>' is not assignable to parameter of type 'NeonQueryFunction<boolean, boolean>'.
Types of property 'transaction' are incompatible.
Type '<ArrayModeOverride extends boolean = false, FullResultsOverride extends boolean = false>(queriesOrFn: NeonQueryPromise<false, false, any>[] | ((sql: NeonQueryFunctionInTransaction<ArrayModeOverride, FullResultsOverride>) => NeonQueryInTransaction[]), opts?: HTTPTransactionOptions<...> | undefined) => Promise<...>' is not assignable to type '<ArrayModeOverride extends boolean = boolean, FullResultsOverride extends boolean = boolean>(queriesOrFn: NeonQueryPromise<boolean, boolean, any>[] | ((sql: NeonQueryFunctionInTransaction<ArrayModeOverride, FullResultsOverride>) => NeonQueryInTransaction[]), opts?: HTTPTransactionOptions<...> | undefined) => Promise...'.
Types of parameters 'queriesOrFn' and 'queriesOrFn' are incompatible.
Type '((sql: NeonQueryFunctionInTransaction<any, any>) => NeonQueryInTransaction[]) | NeonQueryPromise<boolean, boolean, any>[]' is not assignable to type '((sql: NeonQueryFunctionInTransaction<any, any>) => NeonQueryInTransaction[]) | NeonQueryPromise<false, false, any>[]'.
Type 'NeonQueryPromise<boolean, boolean, any>[]' is not assignable to type '((sql: NeonQueryFunctionInTransaction<any, any>) => NeonQueryInTransaction[]) | NeonQueryPromise<false, false, any>[]'.
Type 'NeonQueryPromise<boolean, boolean, any>[]' is not assignable to type 'NeonQueryPromise<false, false, any>[]'.
Type 'NeonQueryPromise<boolean, boolean, any>' is not assignable to type 'NeonQueryPromise<false, false, any>'.
Type 'boolean' is not assignable to type 'false'.ts(2345)
Expected behavior
Expected no type error. A workaround that might work for some folks is to define the generic when calling the neon function:
I think updating neon-http/driver.ts like so resolves the problem, but I'm not familiar with how Drizzle manages dependencies with pnpm, so honestly, I had some trouble performing a quick test against the new driver: 🫣
Correction. I thought this was an issue with changes in the Neon driver, but I think it's a mixture. There's been a change on the Drizzle side too. My mistake.
What version of
drizzle-orm
are you using?0.29.4
What version of
drizzle-kit
are you using?No response
Describe the Bug
Configuring the Neon serverless driver (v0.9.0) with Drizzle ORM using the following code:
Produces this error:
Expected behavior
Expected no type error. A workaround that might work for some folks is to define the generic when calling the
neon
function:Another workaround is to use
drizzle-orm@0.28
.I think updating neon-http/driver.ts like so resolves the problem, but I'm not familiar with how Drizzle manages dependencies with
pnpm
, so honestly, I had some trouble performing a quick test against the new driver: 🫣Environment & setup
Node.js 18
TypeScript 5.3.3
The text was updated successfully, but these errors were encountered: