Skip to content

Parse float8 to number #504

@remiposo

Description

@remiposo

Is your feature request related to a problem? Please describe.

Currently, float4 is being parsed as number, but float8 is returned as string.
https://github.com/denodrivers/postgres/blob/main/query/decode.ts#L72

Based on node-pg-types, it seems that parsing float8 with parseFloat, just like float4, should be fine.
https://github.com/brianc/node-pg-types/blob/master/lib/textParsers.js#L144

Is this difference intentional?
If there’s no specific reason for the difference, I think it would be clearer to align the behavior of the two.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions