Closed fernandortec closed 3 weeks ago
const connection: NeonQueryFunction<boolean, boolean> = neon(env.DATABASE_URL);
this coded fixed the error, Its a very small TS problem, no big deal, I just think you guys should know about it
Having the same issue, following exactly the drizzle docs but still getting a TypeScript error:
Argument of type NeonQueryFunction<false, false> is not assignable to parameter of type NeonQueryFunction<boolean, boolean>
Having the same issue, following exactly the drizzle docs but still getting a TypeScript error:
Argument of type NeonQueryFunction<false, false> is not assignable to parameter of type NeonQueryFunction<boolean, boolean>
Yes, if you follow the exact documentation you'll still get the error, kinda weird no one is talking about it
This resolved the error for me. I do think either the docs need to change or a fix should be made. Copy pasting from docs should not result in errors or warnings.
import { neon, type NeonQueryFunction } from "@neondatabase/serverless";
import { drizzle } from "drizzle-orm/neon-http";
const sql: NeonQueryFunction<boolean, boolean> = neon(process.env.DATABASE_URL!);
const db = drizzle(sql);
You can close my issue and consolidate it here if you like
Docs received a big update recently. If this issue still persists, feel free to reopen this issue.
What version of
drizzle-orm
are you using?0.30.1
What version of
drizzle-kit
are you using?0.20.14
Describe the Bug
When trying to create a connection using Neon, I have a type error in the
drizzle()
function.My code:
Expected behavior
Since I'm following the docs, the code snippet above should throw no errors.
Environment & setup
Node - 20.10.0 Bun - 1.0.30 NextJS - 14.1.3
Drizzle-orm - 0.30.1 Drizzle-kit - 0.20.14 @neondatabase/serverless - 0.9.0
Macbook air M1