Repository navigation
feat: support SOQL SET OPTIONS literals and query options binds - #167
Merged
Merged
Conversation
nawforce
marked this pull request as draft
October 1, 2026 21:08
kjonescertinia
marked this pull request as ready for review
October 2, 2026 08:54
kjonescertinia
approved these changes
Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #165.
Standalone
query()now accepts terminalSET OPTIONS (dataspace = '…', honorEmptyStrings = true|false)lists and whole query-options binds using the existingboundExpression : COLON expressionrule. Inline Apex accepts query-optionsboundExpressionsyntax, verified againstpre-releaseat API 68.0 with empty options, identifier/method-call binds, and count/aggregate queries. Inline literal lists remain rejected. Existing query/select/from/grouping contexts and bound-expression visitor reachability are preserved.Bind expressions are parsed consistently across entry points without an identifier-only predicate. Parenthesized/member/method-call expressions and syntactically valid but inappropriate values such as
:true,:'package', and:opts + 1retain their expression AST for consumer diagnostics. Parsing acceptance is not a guarantee ofDatabase.QueryOptionstype or platform legality in dynamic SOQL. Execution-aware consumers must check bind types, supported placeholder/expression forms, and managed context;queryWithBinds()keys must be validated against the supplied map rather than resolved as static Apex variables. Current apex-ls lacks options-specific validation and does not parse arbitrary dynamic strings.Primary evidence:
query()/queryWithBinds()examples.Context matrix and exact sanitized live probes record actual outcomes, including a map-only key with no same-named Apex variable. REST literal queries succeeded; dynamic Apex literals failed at runtime and inline literals failed compilation (with indirect compiler diagnostics). This separates live inline bind support from the documented managed-dynamic namespace behavior. An undocumented REST namespace Boolean was accepted by the org but is intentionally excluded from this grammar.
Validation:
npm run init;npm run build(196 TypeScript tests, 195 JVM tests);SAMPLES=/Users/kevinjones/adt/apex-samples npm run systestagainst v1.4.0 (100 tests and 100 snapshots passed on the final build); commit hooks (ESLint/Prettier);git diff --check. GitHub CI for commit a9d5908 passed the full build and sample-system-test workflow. Regressions cover acceptance, malformed/misplaced clauses, unsupported literal values, identifier compatibility, permissive bind-expression parsing and traversal, and list/count/aggregate AST shape.Limitations: no discoverable Data 360 objects and no managed package/subscriber setup, so DLO/DMO behavior and namespace semantics were not verified live. Object eligibility, bind value types and managed execution constraints remain semantic; standalone parsing cannot distinguish REST from dynamic Apex. No invented namespace-string forms, static namespace resolution, API gate, or subquery expansion.
Follow-up for apex-ls: adopt the parser dependency and add verified inline bind/standalone query regressions for bind traversal and list/count/aggregate result typing. Options-specific type/context checks must retain the options-clause bind separately from the flattened bind list; dynamic API validation must distinguish map keys from Apex variables.
Database.QueryOptionsdeclarations remain apex-ls#595. No changes outside apex-parser and no analyzer reproduction claimed.