You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQL SELECT parsing via ANTLR4 grammar (case-insensitive keywords)
Pipeline-based query execution: WHERE → GROUP BY → HAVING → WINDOW → ORDER BY → LIMIT → SELECT → DISTINCT
Lazy streaming evaluation for WHERE and SELECT stages; materializing stages for GROUP BY, WINDOW, and ORDER BY
Hash join execution for multi-source JOIN queries
Nested JSON flattening with path-based field keys and query-scoped string interning
Streaming JSON parser for efficient processing of large root arrays
Zero external runtime dependencies beyond the ANTLR4 runtime
SQL Syntax
SELECT with *, specific columns, aliases (AS), and dot-notation aliases for structured nested output
FROM with root reference ($r), nested path drilling ($r.response.data), table names for JOINs, and subqueries
JOIN / INNER JOIN, LEFT JOIN, RIGHT JOIN with equality ON conditions (single or multi-column via AND); chained JOINs supported
WHERE with comparison (=, !=, >, <, >=, <=), pattern matching (LIKE, NOT LIKE), range (BETWEEN, NOT BETWEEN), set membership (IN, NOT IN), and null checks (IS NULL, IS NOT NULL)
GROUP BY with multiple columns and HAVING filter on aggregated aliases
ORDER BY with ASC/DESC on multiple columns and expressions
LIMIT and OFFSET for pagination
DISTINCT for duplicate row elimination
Subqueries in FROM clause (nesting depth bounded by a configurable limit)
Logical connectives AND / OR with parenthesized grouping
Arbitrary nesting of function calls in SELECT, WHERE, GROUP BY, ORDER BY, and HAVING
CASE expressions: Simple (CASE expr WHEN val THEN result END) and searched (CASE WHEN condition THEN result END) forms, usable in SELECT, WHERE, ORDER BY, GROUP BY, and HAVING with full nesting support
JsonCodec — SPI for plugging in external JSON libraries (Jackson, Gson, etc.)
JsonValue — sealed interface providing a library-native, dependency-free JSON abstraction
Configuration & Security Defaults
Sql4jsonSettings — immutable top-level settings record composed of four subsection records; customize any subsection via Sql4jsonSettings.builder()
SecuritySettings:maxLikeWildcards (soft-ReDoS guard on LIKE patterns), redactErrorDetails (multi-tenant information-disclosure guard)
LimitsSettings:maxSqlLength, maxSubqueryDepth (default 16), maxInListSize, maxRowsPerQuery (enforced at GROUP BY, ORDER BY, WINDOW, JOIN, DISTINCT, and the final pipeline/streaming sink)
CacheSettings: bounded LIKE-pattern cache (likePatternCacheSize), optional LRU query-result cache (queryResultCacheEnabled, queryResultCacheSize), plus a pluggable QueryResultCache SPI
Conservative defaults out of the box — protect against denial-of-service and information-disclosure risks in multi-tenant deployments without requiring any configuration