Skip to content

Salesforce SOQL Parser Support in GSP

Explore the Salesforce SOQL Parser product page

SOQL (Salesforce Object Query Language) is Salesforce's object query language. It looks like a SELECT-only subset of SQL but has its own semantics: queries target sObjects instead of tables, use parent-to-child and child-to-parent relationship traversal instead of arbitrary joins, and support Salesforce-specific clauses such as TYPEOF, USING SCOPE, and date literals like LAST_N_DAYS:n.

General SQL Parser (GSP) parses SOQL with a dedicated grammar, giving you a full AST, offline syntax validation, and formatting for SOQL statements embedded in Apex code, integration tools, or data pipelines.

See the SOQL Keyword Compatibility Reference for keyword-as-identifier support.

Syntax Coverage Corpus

GSP tests Salesforce SOQL syntax against 30 documented constructs grouped into 1 categories, each cross-referenced to the documentation that defines it (28 distinct source pages).

Parse coverage

Measured against GSP Java 4.1.11 on 2026-08-10 (UTC) (artifact sha256 71895b6e5ab0). Each construct below carries the complete set of examples from the Salesforce SOQL documentation; a construct counts as fully covered only when every one of its examples parses. Percentages are pass rates over this documented-example corpus — not a percentage of the entire SQL dialect.

Constructs fully parsed Individual statements parsed
All constructs 28 of 30 (93%) 101 of 106 (95%)
SELECT (queries) 28 of 30 (93%) 101 of 106 (95%)
DML (INSERT / UPDATE / DELETE / MERGE)
Stored procedures

Statements are split using the parser's own statement splitter, so multi-statement examples and procedure bodies are counted correctly. The SELECT, DML and stored-procedure rows classify each statement by its parsed statement type: a construct is counted in a row when its examples contain at least one statement of that class, and is fully parsed when all of them parse. Stored procedures covers CREATE PROCEDURE / FUNCTION / PACKAGE / TRIGGER definitions and anonymous blocks.

Machine-readable: dialect data (JSON) · all-dialect matrix · coverage matrix overview

All 30 constructs

Construct Category Parses Specified in
Aggregate Functions SELECT all 6 Salesforce docs
convertCurrency() and Currency Literals SELECT all 4 Salesforce docs
COUNT() and COUNT(fieldName) SELECT all 5 Salesforce docs
Date Functions SELECT all 4 Salesforce docs
Date Literals SELECT 5 of 6 Salesforce docs
FIELDS() SELECT all 6 Salesforce docs
FOR UPDATE SELECT all 1 Salesforce docs
FOR VIEW and FOR REFERENCE SELECT all 2 Salesforce docs
FORMAT() SELECT all 5 Salesforce docs
GROUP BY SELECT all 2 Salesforce docs
GROUP BY CUBE SELECT all 1 Salesforce docs
GROUP BY ROLLUP SELECT all 2 Salesforce docs
HAVING SELECT all 3 Salesforce docs
IN and NOT IN SELECT all 5 Salesforce docs
LIKE SELECT all 2 Salesforce docs
LIMIT SELECT all 2 Salesforce docs
Logical Operators SELECT all 2 Salesforce docs
Multi-Select Picklists (INCLUDES and EXCLUDES) SELECT all 3 Salesforce docs
null in WHERE SELECT all 2 Salesforce docs
OFFSET SELECT all 3 Salesforce docs
ORDER BY SELECT all 6 Salesforce docs
Relationship Query (child-to-parent) SELECT all 3 Salesforce docs
Relationship Query (parent-to-child subquery) SELECT all 5 Salesforce docs
SELECT (basic) SELECT all 4 Salesforce docs
toLabel() SELECT all 3 Salesforce docs
TYPEOF SELECT all 4 Salesforce docs
USING SCOPE SELECT all 4 Salesforce docs
WHERE SELECT all 4 Salesforce docs
WITH DATA CATEGORY SELECT all 3 Salesforce docs
WITH SECURITY_ENFORCED SELECT 0 of 4 Salesforce docs