Skip to content

feat: W-18338854 - execute soql query commands don't rely on CLI anymore #6400

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

Merged
merged 10 commits into from
Jul 8, 2025

Conversation

CristiCanizales
Copy link
Contributor

What does this PR do?

This pull request introduces significant enhancements to the SOQL query execution functionality in the dataQuery.ts file. The changes include refactoring the DataQueryExecutor class to use the LibraryCommandletExecutor, improving error handling, introducing CSV export capabilities, and updating i18n messages for better user feedback.

Enhancements to SOQL Query Execution:

  • Refactored DataQueryExecutor to use LibraryCommandletExecutor for improved handling of SOQL queries. Added methods for executing queries, displaying results in a table format, converting results to CSV, and saving them to a file. Enhanced error handling to provide specific messages for common issues, such as session expiration or malformed queries.

Improvements to API Type Handling:

  • Updated ApiType enum to use uppercase naming (TOOLING instead of Tooling) for consistency.
  • Adjusted references to ApiType.Tooling in the GetQueryAndApiInputs class to align with the updated enum naming convention.

Updates to i18n Messages:

  • Added new localized messages for success and error scenarios, including detailed error descriptions for cases like invalid login credentials, insufficient access rights, and connection issues. These messages improve user feedback during query execution.

What issues does this PR fix or reference?

@W-18338854@

@CristiCanizales CristiCanizales self-assigned this Jul 4, 2025
@CristiCanizales CristiCanizales requested a review from a team as a code owner July 4, 2025 20:14

// Open the file in editor
const document = await vscode.workspace.openTextDocument(filePath);
await vscode.window.showTextDocument(document);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running queries is an async task, do we really want to force a focus change in the UI?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. preserveFocus:false would open the document but not steal focus? Or are you thinking of something else?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking to show the success notification and a "Open file" button in case the user wants to review it. Wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good


// Open the file in editor
const document = await vscode.workspace.openTextDocument(filePath);
await vscode.window.showTextDocument(document);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. preserveFocus:false would open the document but not steal focus? Or are you thinking of something else?

Copy link
Contributor

@mshanemc mshanemc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code:
❌ linter warnings are no good. I'm going to fix those with some PR/types changes.

QA notes:
✅ queries fine when entering the query
✅ good error when I do an invalid query
❌ see comment about blank line in output being non-reproducible
✅ did SELECT COUNT() FROM Property__c from highlighted text in dreamhouse repo, got fine result

@mshanemc mshanemc dismissed peternhale’s stale review July 8, 2025 21:00

resolved (requires button click in notification to view the results csv)

@CristiCanizales CristiCanizales merged commit 02b1fbc into develop Jul 8, 2025
8 checks passed
@CristiCanizales CristiCanizales deleted the cristi/queryUser branch July 8, 2025 21:04
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.

3 participants