I am getting an error when I defined the db

I have downloaded the necessary package using the bun but still it's throwing an error.
No description
10 Replies
Boby
BobyOP3mo ago
No description
oke
oke2mo ago
Drizzle ORM - Neon
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
oke
oke2mo ago
You're supposed to use
const sql = neon(process.env.DATABASE_URL!);
const db = drizzle({ client: sql });
const sql = neon(process.env.DATABASE_URL!);
const db = drizzle({ client: sql });
Boby
BobyOP2mo ago
thanks for your help @oke but I am still getting this error
Boby
BobyOP2mo ago
No description
oke
oke2mo ago
That's a weird error. Maybe try restarting VSCode or restarting the Typescript server
Boby
BobyOP2mo ago
I tried restarting the ts server but error still persisted
Ganbatte
Ganbatte2mo ago
Maybe try this: import { neon } from '@neondatabase/serverless'; import { drizzle } from 'drizzle-orm/neon-http'; import * as schema from './schema'; const sql = neon(process.env.NEON_DATABASE_URL!); const db = drizzle(sql, { schema }); export default db; It is worked for me.
Boby
BobyOP2mo ago
thanks @Ganbatte but I have already tried this and it was throwing an error
Boby
BobyOP2mo ago
GitHub
[BUG]: not able to parse the schema in the drizzle function · Issue...
What version of drizzle-orm are you using? ^0.35.3 What version of drizzle-kit are you using? ^0.26.2 Describe the Bug I am getting an error that expected one argument but got two Expected behavior...
Want results from more Discord servers?
Add your server