A tenant dataset source links a tenant and a base dataset to a connection and a table ( source_sheet ) or SQL query ( source_query ). When an embed token of that tenant queries the base dataset, Luzmo queries the tenant's table or query instead of the base dataset's own source. Callers without a tenant keep querying the base dataset's source.
The tenant's table or query must contain every shared field of the base dataset: each column that has a source_name , is not a derived column, and is not assigned to a tenant. A shared field matches a column of the tenant's table or query when source_name , type and source_type are all equal. The tenant's table or query can contain additional columns: these are the tenant's own fields.
Tenant field discovery
When an embed token of the tenant retrieves the base dataset with a Column include, the response also contains the additional columns of the tenant's table or query. These are discovered fields: they are not saved yet. A where , limit or offset on the Column include leaves them out.
A discovered field has a deterministic id : the same tenant, dataset and source column always give the same id.
Search Column does not return a discovered field, and updating or deleting it returns 404 .
A discovered field is saved the first time the tenant uses it in a data query, or references it in the expression of a derived column or formula. Luzmo then saves it as a column of the base dataset, with the same id , assigned to the tenant. Referencing it in an expression requires use rights on the dataset through the token's rights .
A saved column behaves like any other tenant field. Changing it requires modify through the token's tenant_fields_rights (see Create Authorization ).
Queries on a tenant dataset source don't use the base dataset's acceleration . They always run on the tenant's table or query.
Only main-organization users can create, retrieve, update or delete tenant dataset sources. For other callers, such as embed tokens of a tenant, these requests fail with 403 .
Delete a tenant dataset source. The tenant's queries use the base dataset's source again.
All columns saved from this tenant dataset source are deleted. Derived columns and formulas of the tenant are not deleted, even when their expression references a deleted column.
npm install @luzmo/nodejs-sdk{
"code": 200
}