drizzle-team / drizzle-orm

Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
https://orm.drizzle.team
Apache License 2.0
24.47k stars 643 forks source link

[BUG]: Introspection fails sonb_build_array(" is not valid JSON. #2965

Open wilsonowilson opened 2 months ago

wilsonowilson commented 2 months ago

What version of drizzle-orm are you using?

0.33.0

What version of drizzle-kit are you using?

0.24.2

Describe the Bug

I'm trying to switch from prisma to drizzle. To begin, I've tried introspecting my database, but it fails with an error sonb_build_array(" is not valid JSON.

No logs either. Any idea what could be causing this

npx drizzle-kit introspect

No config path provided, using default 'drizzle.config.ts'
Reading config file '/Users/wilson/Developer/Projects/senja/apps/api/drizzle.config.ts'
Pulling from ['public'] list of schemas

Using 'postgres' driver for database querying
[✓] 49  tables fetched
[⣟] 471 columns fetching
[✓] 0   enums fetched
[⣟] 0   indexes fetching
[⣟] 9   foreign keys fetching
undefined:1
sonb_build_array(
^

SyntaxError: Unexpected token 's', "sonb_build_array(" is not valid JSON
    at JSON.parse (<anonymous>)
    at defaultForColumn (/Users/wilson/Developer/Projects/senja/node_modules/.pnpm/drizzle-kit@0.24.2/node_modules/drizzle-kit/bin.cjs:19380:55)

Expected behavior

For drizzle to generate a schema my database

Environment & setup

No response

iscekic commented 3 weeks ago

+1 having the same issue

L-Mario564 commented 3 weeks ago

Can you provide steps to reproduce this bug?