Skip to content

feat: Salesforce SOQL INCLUDES and EXCLUDES operators #1985

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

Conversation

lucarota
Copy link
Contributor

Hi all,

This pull request introduces the INCLUDES and EXCLUDES operators for parsing the Salesforce Object Query Language (SOQL), a variant of SQL specifically designed for querying Salesforce data.

The INCLUDES operator allows users to query for records where a picklist or multipicklist field includes one or more values from a specified set.

The EXCLUDES operator, on the other hand, enables users to query for records where a specified field does not include any values from a specified set.

The syntax for using the INCLUDES and EXCLUDES operators in SOQL is similar as the standard IN and NOT IN as follows:

INCLUDES:

SELECT fields FROM object WHERE field INCLUDES (value1, value2, ...)

EXCLUDES:
SELECT fields FROM object WHERE field EXCLUDES (value1, value2, ...)

  • The INCLUDES and EXCLUDES operators are case-insensitive.
  • Multiple values can be provided within the parentheses, separated by commas.
  • These operators can only be used with fields of type Picklist or Multi-Select Picklist.

Ciao,
Luca

@manticore-projects
Copy link
Contributor

Clean! Thank you very much for your contribution, kudos!

@manticore-projects
Copy link
Contributor

Please fix the formatting, run './gradlew :spotlessApply' to fix these violations. Then I would merge.

@manticore-projects manticore-projects merged commit f3f0e05 into JSQLParser:master Mar 31, 2024
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