Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up query results copying #25866

Merged
merged 11 commits into from
Sep 13, 2024
4 changes: 4 additions & 0 deletions src/sql/azdata.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,10 @@ declare module 'azdata' {
* The selected ranges to be copied.
*/
selections: SelectionRange[];
/**
* Whether to copy results from the UI process.
*/
copyFromUIProcess?: boolean;
lewis-sanchez marked this conversation as resolved.
Show resolved Hide resolved
}

export interface CopyResultsRequestResult {
Expand Down
8 changes: 5 additions & 3 deletions src/sql/workbench/services/query/common/queryRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,10 +618,12 @@ export class QueryGridDataProvider implements IGridDataProvider {
private async handleCopyRequestByProvider(selections: Slick.Range[], includeHeaders?: boolean): Promise<void> {
executeCopyWithNotification(this._notificationService, this._configurationService, selections, async () => {
let results = await this.queryRunner.copyResults(selections, this.batchId, this.resultSetId, this.shouldIncludeHeaders(includeHeaders));
let clipboardData: ClipboardData = {
text: results.results
if (results.results) {
let clipboardData: ClipboardData = {
text: results.results
}
this._clipboardService.write(clipboardData);
}
this._clipboardService.write(clipboardData);
});
}

Expand Down