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 ๐
2 Replies
you found any solution of this problem ??
Hello, @Mast_Qalandar, PR with fix is in development
https://github.com/drizzle-team/drizzle-orm/pull/1946
GitHub
Fix neon serverless generic by evanshortiss ยท Pull Request #1946 ยท ...
Fix, albeit maybe not optimal, for #1945