SOQL Files#
VS Code supports writing SOQL in both Apex files and standalone .soql
files. When writing .soql
files, we recommend that the file is located outside the directories registered in your sfdx-project.json
because this is not a file to deploy to your org. The purpose of the .soql
file is to provide a way to build and test a SOQL query before you import it to your Apex code. By default, a new project has a folder scripts/soql
that contains an example accounts.soql
file. You can use this folder to save all of your SOQL queries.
Code Completions#
VS Code supports code completions for SOQL .soql
files (and will eventually support code completion in Apex files). To use this feature, you must refresh the SObject definitions so that the SOQL language server can provide code completion suggestions. Run SFDX: Refresh SObject Definitions
from the Command Palette.
- To see code completion suggestions, press Ctrl+space when you’re working in a
.soql
file. - To navigate between the suggestions, use the arrow keys.
- To auto-complete from the suggestion, press Enter.
Recent Comments