Skip to content

[BUG]: jsonb values are double-JSON.parse()'d on select #3018

@legitmaxwu

Description

@legitmaxwu

What version of drizzle-orm are you using?

0.33.0

What version of drizzle-kit are you using?

0.23.0

Describe the Bug

I'm using drizzle + node postgres.

When I store a string e.g. "10.5" under a jsonb column, I expect it to be returned as "10.5" in string format. Instead it's returned as 10.5

This is probably because node-postgres does JSON.parse once, and then the jsonb column does it again.

Expected behavior

When I store a string e.g. "10.5" under a jsonb column, I expect it to be returned as "10.5" in string format.

Environment & setup

drizzle + node postgres
computer: macos

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdb/postgrespriorityWill be worked on next

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions