-
Notifications
You must be signed in to change notification settings - Fork 189
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
Allow exporting of results for non-alert queries #929
Conversation
43d298a
to
53a8cf7
Compare
53a8cf7
to
8c1e8a4
Compare
Rebased to fix a conflict in the CHANGELOG. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll let someone else review/approve who's more comfortable with the code changes (especially the changes to run-queries
), but I tried this locally and it seems to work 😊
Thanks for the helpful comments @aeisenberg and @shati-patel! I've pushed an additional commit addressing them. |
4476955
to
d01278d
Compare
Co-authored-by: Shati Patel <[email protected]>
@@ -216,6 +218,29 @@ export class QueryInfo { | |||
return this.dilPath; | |||
} | |||
|
|||
async exportCsvResults(qs: qsClient.QueryServerClient, csvPath: string, onFinish: () => void): Promise<void> { | |||
let stopDecoding = false; | |||
const out = fs.createWriteStream(csvPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the csv file already exists, then maybe no need to recreate it? Though if the operation is fast, not a big deal either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is already not being called if the file already exists (see this line)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like all comments are addressed :)
Super excited to see this in the next release, thanks! |
Closes #832
This PR adds a new right click option in the Query History view called Export Results (CSV) which will export the results of a non-alert query to a CSV file (as chosen in a save dialog displayed to the user).
Checklist
@github/docs-content-codeql
has been cc'd in all issues for UI or other user-facing changes made by this pull request.