Postgrest inserting json array results in stringified array
I'm trying to insert a an array of objects as a json array but it always ends up being strinfied
if it would be just a json then i can do
sql
${recipeData.notes}::jsonb` but that doesn't work with arrays (
cannot cast type record to jsonb`)4 Replies
hey! I noticed the same issue, having a jsonb doesn't save the array, but just a string instead. I have my column defined like this:
any way to make it save an actual array instead of the string?
seems like known issue https://github.com/drizzle-team/drizzle-orm/issues/724
GitHub
[BUG]: jsonb always inserted as a json string when using postgres-j...
What version of drizzle-orm are you using? 0.26.5 What version of drizzle-kit are you using? 0.18.1 Describe the Bug Inserting an object into a postgres jsonb field with db.insert only inserts a st...
i ended up using a custom json field
yeah that works or use jsonb objects instead if arrays