Repository navigation
feat(ts): queryOrdered returns the projection order - #1182
Merged
Merged
Conversation
Forward the core's query_ordered through napi as { columns, rows }, so a caller can render columns in the order the SELECT list names them.
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.
Fixes #1174
Adds
db.queryOrdered(sql): Promise<QueryResult>to the TypeScript SDK, the counterpart of Rust'sDirSQL::query_orderedfrom #1171.I added a separate accessor instead of promising key order on
query()'s rows. A JS object can't hold that order: integer-like keys always enumerate first.query()is unchanged.queryOrderedAsyncTask (it runs on the threadpool, likequery) and an output-onlyQueryResultobject. Unsafe integers still throw, as they do inquery.readyand forwards the SQL.QueryResultis exported from the barrel.queryOrderedsection with TS and Rust tabs.Red/green
Red commit 2c22bb6: the Integration tests (Node 24) job in run 35994554211 failed with
TypeError: db.queryOrdered is not a functionin the new hermetic test. The implementation followed in 42282d8.Manual run
A Node script imports the built
dist/index.jsand usesSELECT name, age, 1 AS "2", 7 AS z:E2E Verification
packages/rust/srcuntouched)packages/python/e2e-attestations/<branch>.jsonreceipt written ifpackages/pythonchanged: N/Apackages/ts/e2e-attestations/<branch>.jsonreceipt written (just e2e-attest-ts)just e2e-attest-ts,just preflight,cargo test/cargo clippy -D warningsonpackages/ts/napi, full vitest runChangelog / Migrations
packages/ts/changelog.d/packages/ts/migrations.d/(additive; the gate requires one for any public-surface change)