Skip to content

pg: the sqlx-path result object (command/rowCount/rows) reads back undefined from TypeScript #10331

Description

@proggeramlug

Problem

Perry's pg binding's result object is unreadable from TypeScript on the sqlx (legacy, currently-shipping) transport path. res.command, res.rowCount and res.rows all read back undefined.

Reproducer

On Perry's base commit 7f77cce3c6, every query in a straightforward pg fixture prints:

create: command=undefined rowCount=undefined rows=undefined

Status

Fixed for clients that take the (unmerged) turnloop transport path added by Perry's P7 lane — but the currently-shipping sqlx-based path on main still has this bug. Two related divergences from node-postgres, also reproduced on the base commit, are worth tracking alongside this if not folded into the same fix:

Node Perry base (sqlx path)
rowCount on INSERT/UPDATE/DELETE the affected count undefined
rowCount on DDL null undefined

What would fix it

Whatever conversion step turns the sqlx query result into the JS-visible result object is not populating command/rowCount/rows at all on this path. The turnloop-side fix (unmerged) is a working reference for the expected shape.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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