Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Drizzle reformating JSON values ending up in Postgres unable to parse it #1203

Closed
xegulon opened this issue Sep 12, 2023 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@xegulon
Copy link

xegulon commented Sep 12, 2023

What version of drizzle-orm are you using?

0.28.6

What version of drizzle-kit are you using?

No response

Describe the Bug

The bug is the one mentionned here: https://stackoverflow.com/questions/77068776/postgres-error-22p02-escape-sequence-e-is-invalid

Before inserting an object with a field that is an array of strings (or an array of json), drizzle seems to be formatting the data, which ends in Postgres being unable to parse it correctly.

There was a similar issue in node-postgres, which seems to have been resolved.

Thanks guys for the amazing work and pleasure to use Drizzle ORM <3

Expected behavior

I would expect Drizzle not to reformat my data badly :)

Environment & setup

Linux. I use Drizzle in conjunction with @vercel/postgres.
When using a raw query with @vercel/postgres to insert my data, I have no problem.

@xegulon xegulon added the bug Something isn't working label Sep 12, 2023
@MHB2011
Copy link

MHB2011 commented Sep 16, 2023

I have the same problem. Any solutions other than using raw sql ?

@jkcorrea
Copy link

jkcorrea commented Oct 9, 2023

@xegulon @MHB2011 fix is here #666 (comment)

@Angelelz
Copy link
Collaborator

This issue is related to #1511. I'll close this one in favor of that one because there of the discussion over there. I'll work on this pretty soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants