ECSQLOPTIONS or OPTIONS clause

ECSQLOPTIONS (or OPTIONS for short) specifies flags that affect processing of the ECSQL statement.

Syntax: <select-stmt> OPTIONS option[=val] [option[=val] ...]

Supported options include:

  1. USE_JS_PROP_NAMES formats JSON from the instance accessor using JavaScript property names and class-name values.
  2. DO_NOT_TRUNCATE_BLOB returns the full blob instead of truncating it when using the instance accessor.
  3. ENABLE_EXPERIMENTAL_FEATURES enables experimental features.
  4. NAV_REL_CLASSID_FALLBACK treats an end-table navigation property with a non-null Id and null RelECClassId as an instance of the relationship declared by the navigation property. It affects relationship class queries and ECVLib.Relations(), but does not change the stored navigation property's RelECClassId.

NAV_REL_CLASSID_FALLBACK is intended for legacy data that omitted the relationship class id. It adds an OR ... IS NULL predicate and an IFNULL projection, which may result in less efficient query plans. Enable it only for queries that need the compatibility behavior.

USE_JS_PROP_NAMES controls the JSON produced by the $ instance accessor and is distinct from reader formatting. The similarly named reader option QueryRowFormat.UseJsPropertyNames, which controls the surrounding query-row representation, is deprecated. See ECSQL row formats.

Get an instance as JSON with iTwin.js property names:

SELECT $ FROM [BisCore].[Element] OPTIONS USE_JS_PROP_NAMES /* $ -------------------- { "id":"0x1", "className":"BisCore.Subject", "model":{ "id":"0x1", "relClassName":"BisCore.ModelContainsElements" }, "lastMod":"2023-12-06T15:24:45.785Z", "codeSpec":{ "id":"0x1f", "relClassName":"BisCore.CodeSpecSpecifiesCode" }, "codeScope":{ "id":"0x1", "relClassName":"BisCore.ElementScopesCode" }, "codeValue":"Subject of this imodel", "description":"" } */

ECSql Syntax

Last Updated: 28 October, 2026