Skip to content

fix: fresh headers per paged request, cap SQL results at TOP (#172) - #175

Open
zekelinAlex wants to merge 1 commit into
TALXIS:masterfrom
zekelinAlex:users/alexander.zekelin/fix-sql-query-cookie-issue-172
Open

fix: fresh headers per paged request, cap SQL results at TOP (#172)#175
zekelinAlex wants to merge 1 commit into
TALXIS:masterfrom
zekelinAlex:users/alexander.zekelin/fix-sql-query-cookie-issue-172

Conversation

@zekelinAlex

@zekelinAlex zekelinAlex commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

ServiceClient.ExecuteWebRequest mutates the header dictionary it receives by adding a Cookie entry. We passed the same dictionary to every paged request, so fetching any @odata.nextLink page failed with "An item with the same key has already been added. Key: Cookie". Each request now gets a fresh dictionary, in DataverseQueryService and in SolutionComponentQueryReader.

The ?sql= endpoint turns TOP n into a page size, not a row limit, so SELECT TOP 5 on a bigger table returned five rows plus a nextLink and hit the crash above. Following the links would also download the whole table in pages of five, so the client now reads TOP from the query and stops at that many rows; with --top, the smaller limit wins.

The FROM parser also accepts dbo.account and bracketed names like [account] now. The endpoint always took these, we just failed to extract the table name from them.

Close #172

@zekelinAlex zekelinAlex changed the title fix: fresh headers per paged request, cap SQL results at TOP fix: fresh headers per paged request, cap SQL results at TOP (#172) Jul 21, 2026
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.

bug: querying data through SQL doesn't work

1 participant