Arthur
DTDrizzle Team
•Created by Arthur on 3/1/2024 in #help
Error with drizzle (sql)
Hey guys,
I created a index.ts file to set up neon and drizzle
import { neon, neonConfig } from '@Neondatabase/serverless';
import {drizzle} from "drizzle-orm/neon-http";
neonConfig.fetchConnectionCache = true
if(!process.env.DATABASE_URL) {
throw new Error ('database url not found'); }
const sql = neon(process.env.DATABASE_URL);
export const db = drizzle(sql);
But i have an error on sql in drizzle(sql) and can't figure out the solution.
"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...'. "
Thanks for the support 🙂
3 replies