Data 360 and query options
Use generated Data 360 capabilities and managed dynamic Apex query options.
Kysoql codegen recognises Data Lake Objects (__dll) and Data Model Objects
(__dlm) and records the SET OPTIONS capability on each generated object.
Use the object and field names from your own org.
Data Lake Objects
DLO queries can supply a dataspace and opt into empty-string handling:
import { db } from "./db";
const rows = db
.selectFrom("ContactPoint__dll")
.select(["Id", "EmailOptIn__c"])
.setOptions({
dataspace: "default",
honorEmptyStrings: true,
});When you call setOptions() on a DLO, dataspace is required and must be
non-empty. Kysoql does not choose a dataspace for you.
Data Model Objects
DMO record queries can enable honorEmptyStrings:
import { db } from "./db";
const rows = db
.selectFrom("UnifiedIndividual__dlm")
.select("Id")
.setOptions({ honorEmptyStrings: true });Ordinary CRM objects do not expose these Data 360 options. Generated metadata
also lets Kysoql catch several Data 360-specific grouping, HAVING, relationship,
and semi-join restrictions before execution.
Managed dynamic Apex options
A bound Database.QueryOptions value is a different feature from the object-shaped
Data 360 options:
import { apexBind, type ApexDatabaseQueryOptions } from "@kysoql/core";
import { db } from "./db";
const compiled = db
.selectFrom("Account")
.select(["Id", "Name"])
.dynamicApex()
.setOptions(apexBind<ApexDatabaseQueryOptions>("queryOptions"))
.compile();ApexDatabaseQueryOptions is a type marker for the Apex value supplied by your
caller. Kysoql does not create that Apex object or execute the query.
Use dynamicApex() for this overload. It is not available through normal REST,
JSforce, or static .apex() queries.