Skip to content

fix: preserve row mode in native pipelines - #3742

Merged
brianc merged 1 commit into
brianc:masterfrom
zfaustk:fix/native-pipeline-row-mode
Aug 12, 2026
Merged

fix: preserve row mode in native pipelines#3742
brianc merged 1 commit into
brianc:masterfrom
zfaustk:fix/native-pipeline-row-mode

Conversation

@zfaustk

@zfaustk zfaustk commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

What changed

Native pipeline entries now retain each query's array mode, and pg-native uses that mode when it builds the corresponding pipeline result.

The regression test mixes rowMode: 'array' and the default object mode in one connected pipeline batch, so it also verifies that row mode does not leak between queries.

Why

The non-pipeline native path applies NativeQuery._arrayMode before reading a result, but the pipeline path dropped that per-query value. A rowMode: 'array' query therefore returned object rows when pipeline: true.

This is observable downstream in drizzle-team/drizzle-orm#6118: interpreted mapping produced undefined fields and JIT mapping threw TypeError: object is not iterable.

Verification

  • New integration test fails on ff9d775 in native mode (object row returned instead of [10]).
  • The focused pipeline integration file passes in both JavaScript and native modes after the fix.
  • The original Drizzle reproduction passes for native direct queries plus interpreted and JIT mapping, with and without pipelining.
  • Repository-wide ESLint passes; the three changed files pass Prettier check.
  • The pg unit suite passes.

The canonical full yarn test matrix was not completed locally: its Yarn 1 workspace install caches unrelated multi-platform optional binaries beyond this executor's bounded disk budget. GitHub CI remains the authoritative full matrix.

Compatibility

No public API is added or changed. The native pipeline path now matches the existing per-query rowMode behavior of the non-pipeline and JavaScript clients.

AI assistance

Codex was used for investigation, implementation, and test execution. No human-review attestation is made.

@brianc brianc left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohhhh very nice! good find 👍

@brianc
brianc merged commit 7bee4db into brianc:master Aug 12, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants