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

  1. TheHypnoo commented on Sep 28, 2026

    @TheHypnoo
    Member

    Closing as obsolete: the native pg binding was removed in 6e0f111 (#10677, 2026-09-21); pg now compiles from source. This issue describes the removed native implementation, so it no longer applies. If the same behavior reproduces with the real npm package compiled from source on current main, please open a new issue against that path.

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