Skip to main content

SQL++ and QueryBuilder Differences

Description — Differences between Couchbase Lite's QueryBuilder and SQL++ for Mobile
Related Content — SQL++ for Mobile | QueryBuilder | Indexes
info

N1QL is Couchbase's implementation of the developing SQL++ standard. As such the terms N1QL and SQL++ are used interchangeably in all Couchbase documentation unless explicitly stated otherwise.

Couchbase Lite's SQL++ for Mobile supports all QueryBuilder features. See Table 1 for the features supported by SQL++ but not by QueryBuilder.

Table 1. QueryBuilder Differences
CategoryComponents
Conditional OperatorCASE(WHEN …​ THEN …​ ELSE ..)
Array FunctionsARRAY_AGG, ARRAY_AVG, ARRAY_COUNT, ARRAY_IFNULL, ARRAY_MAX, ARRAY_MIN, ARRAY_SUM
Conditional FunctionsIFMISSING, IFMISSINGORNULL, IFNULL, MISSINGIF, NULLIF, Match Functions, DIV, IDIV, ROUND_EVEN
Pattern Matching FunctionsREGEXP_CONTAINS, REGEXP_LIKE, REGEXP_POSITION, REGEXP_REPLACE
Type Checking FunctionsISARRAY, ISATOM, ISBOOLEAN, ISNUMBER, ISOBJECT, ISSTRING, TYPE
Type Conversion FunctionsTOARRAY, TOATOM, TOBOOLEAN, TONUMBER, TOOBJECT, TOSTRING