Code Monkey home page Code Monkey logo

soqe's Introduction

SOQE (saké) 🦄

Salesforce Object Query Extension

Free to install here on the VS Code marketplace

SOQE View

Features

  • view Salesforce data quickly & easily in vs code

    • have potential to use data for LWC/Node/JS testing, scratch pads, etc
  • choose to save to look back at what was queried before

    • saves under {PROJECT ROOT}/.soql
  • run in a SFDX project w/o any extra config

    • works in any project as long as {PROJECT ROOT}/.sfdx/sfdx-config.json contains a defaultusername key/value -- for integrations, etc

    • surfaces a message when no defaultusername is found

  • attempts to surface only the important parts of error messages from sfdx (if need be)

Hotkeys

  • inside the text editor, you can hit Ctrl+Enter to run the query
  • inside the text editor, you can hit Ctrl+Shift+Enter to run the query & save it

Made with 💙 by Jamie Smith

soqe's People

Contributors

jsmithdev avatar dependabot[bot] avatar

Stargazers

Jason Auger avatar Reid Efford avatar

Watchers

 avatar James Cloos avatar Jason Auger avatar Reid Efford avatar

soqe's Issues

use error msg from sfdx

Happens when non throwing error gets sent back as stdout.

After parsing,

  • Check res.status === 1
    • send res.message to toast; return;

Example response:
{
"status": 1,
"name": "Error",
"message": "\nSELECT Id, CaseNumber, ContactId.FirstName, ContactId.LastName\n ^\nERROR at Row:1:Column:24\nDidn't understand relationship 'ContactId' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.",
"exitCode": 1,
"commandName": "DataSoqlQueryCommand",
"stack": "Error: \nSELE....",
"warnings": []
}

Type error

Error

Type error is caught but message is not surfaced;

Checklist

  • Surface error message
  • Test by checking Boolean field as you would a String field eg. WHERE Checkbox__c != ''

Example error response

{
"status": 1,
"name": "INVALID_FIELD",
"message": "\nCustomer_Not_Home__c FROM WorkOrder WHERE Customer_Not_Home__c != '' LIMIT\n ^\nERROR at Row:1:Column:54\nvalue of filter criterion for field 'Customer_Not_Home__c' must be of type boolean and should not be enclosed in quotes",
"exitCode": 1,
"context": "DataSoqlQueryCommand",
"etc: "..."
}

Multi-line SOQL Query Fails

When writing a multi-line query such as

SELECT Count(Id), Account.Id FROM Contact 
WHERE Account.Id != null 
GROUP BY Account.Id

instead of in a single line, an error is thrown as the new lines are replaced as a string length 0. When spaces are added to the end of the lines, the query works correctly.

Would suggest changing the '' in

const query = data.query.replace(/\n/g, '').trim()
to replace with a space instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.