Repository navigation
test: lock Postgres NDJSON meta from result.fields (#11) - #13
Merged
Merged
Conversation
ChuTingzj
marked this pull request as ready for review
September 21, 2026 04:52
ChuTingzj
commented
Sep 21, 2026
ChuTingzj
left a comment
Contributor
Author
There was a problem hiding this comment.
Pre-scan (533f9d4)
Blocker for merge: base is still cursor/postgres-meta-columns-6f52 (4f5752a), not main (c09de54 where #12 landed). Rebase onto main first, then re-request review.
Content (looks good once rebased): locks the real #11 failure mode — host consumeNdjsonResult gets non-empty columns from NDJSON meta, with a Query that throws if fields is emitted. Zero-row schema + execute.js / pg-query-stream.js source guards are the right layer above #12’s unit tests.
No code must-fix in the test file itself. Hold merge until rebase.
Regression stacked on the #12 runner fix: pg 8.x Result.fields must become NDJSON meta columns even when Query never emits a fields event. Co-authored-by: zhangjing <zhangjing798@qq.com>
cursor
Bot
force-pushed
the
cursor/postgres-meta-regression-27e4
branch
from
September 21, 2026 04:55
533f9d4 to
6875bdf
Compare
cursor
Bot
changed the base branch from
cursor/postgres-meta-columns-6f52
to
main
September 21, 2026 04:55
ChuTingzj
commented
Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Relates to #11 — #11
Rebased onto
mainafter #12 squash-merge (c09de54). Tests only; no runner image or npm publish.Why
#12 landed the runner fix (
streamPgQuery+ unit tests on event objects). This PR locks the host-visible NDJSON contract that issue #11 actually broke:consumeNdjsonResultgettingcolumns: []because pg 8.x never emitsfields.Asserted
Against the Postgres execute path (
streamPgQuery) with a mocked pg 8.xResult(FieldDef[]onresult.fields):fields—Pg8Query.emit('fields')throws;fieldsEmitted === 0.{"type":"meta","columns":["order_date","daily_total"]}fromresult.fields.consumeNdjsonResultreturns those column names (not[]).endwithresult.fieldsstill writes meta then end.streamPgdelegates tostreamPgQueryand does notquery.on('fields').These tests fail on fields-event-only code (rows/
end, nometa,columns: []) and pass on currentmain+ this commit.How to run
pnpm test pnpm typecheck pnpm buildLocal: 63 tests, 0 failures. Do not merge. Do not publish npm.