N
Neon2y ago
genetic-orange

Typescript error: Argument of type 'NeonQueryFunction<false, false>'

Hey guys. So I've been getting this ts error and I'm not sure how to fix it. It's happening on my index.ts inside src/db, on drizzle(sql). It does not break my code in any way, but its pretty annoying. import { neon } from "@neondatabase/serverless" import { drizzle } from "drizzle-orm/neon-http" const sql = neon(process.env.DATABASE_URL!) export const db = drizzle(sql) The error happens on (sql) from the code above. Anyone knows how to fix/ignore this? 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'.
No description
7 Replies
foreign-sapphire
foreign-sapphire2y ago
GitHub
GitHub - neondatabase/drizzle-overview: Demo Drizzle ORM, Hono & Ne...
Demo Drizzle ORM, Hono & Neon API. Contribute to neondatabase/drizzle-overview development by creating an account on GitHub.
passive-yellow
passive-yellow2y ago
@coelho 🐇
import { neon } from "@neondatabase/serverless"
import { drizzle } from "drizzle-orm/neon-http"

const sql = neon<boolean, boolean>(process.env.DATABASE_URL!)
export const db = drizzle(sql)
import { neon } from "@neondatabase/serverless"
import { drizzle } from "drizzle-orm/neon-http"

const sql = neon<boolean, boolean>(process.env.DATABASE_URL!)
export const db = drizzle(sql)
This seems to suppress it for now. Will get this looked into
genetic-orange
genetic-orangeOP2y ago
Ty Evan, this fixed the error
foreign-sapphire
foreign-sapphire2y ago
@ShinyPokemon please ping me on the fix/issue. Really curious what the heck is going on here
passive-yellow
passive-yellow2y ago
@Tristan Partin I tried to do a bit deeper yesterday but have flu so my brian isn't operating at 100% 😄 Basically it seems like we updated the generic parameters in the serverless driver to have defaults, and the drizzle driver doesn't like it. I think know what the PR needs to be to drizzle, but the drizzle project is a tad complicated and pins older serverless driver versions. I'll open an issue with what I'ev found and link it here shortly
passive-yellow
passive-yellow2y ago
GitHub
[BUG]: neondatabase/serverless generic type defaults cause type err...
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 ...
protestant-coral
protestant-coral2y ago
I've tested that this is resolved in Drizzle https://orm.drizzle.team/learn/latest-releases/drizzle-orm-v0303
Drizzle ORM - DrizzleORM v0.30.3 release
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.

Did you find this page helpful?