@@ -9,11 +9,11 @@ For similar functionality in YAML, see [Dynamic data models with Jinja and Pytho
99</InfoBox >
1010
1111Cube allows data models to be created on-the-fly using a special
12- [ ` asyncModule() ` ] [ ref-async-module ] function only available in the [ schema
13- execution environment] [ ref-schema-env ] . ` asyncModule() ` allows registering an
12+ [ ` asyncModule() ` ] [ ref-async-module ] function only available in the
13+ [ execution environment] [ ref-schema-env ] . ` asyncModule() ` allows registering an
1414async function to be executed at the end of the data model compile phase so
1515additional definitions can be added. This is often useful in situations where
16- schema properties can be dynamically updated through an API, for example.
16+ data model properties can be dynamically updated through an API, for example.
1717
1818<WarningBox >
1919
@@ -91,7 +91,7 @@ generate data models from that data:
9191 /product/data-modeling/dynamic/schema-execution-environment#cube-js-globals-cube-and-others
9292
9393``` javascript
94- // model/cubes/DynamicSchema .js
94+ // model/cubes/DynamicDataModel .js
9595const fetch = require (" node-fetch" );
9696import {
9797 convertStringPropToFunction ,
@@ -144,10 +144,10 @@ asyncModule(async () => {
144144});
145145```
146146
147- ## Usage with schemaVersion
147+ ## Usage with ` schema_version `
148148
149149It is also useful to be able to recompile the data model when there are changes
150- in the underlying input data. For this purpose, the [ ` schemaVersion `
150+ in the underlying input data. For this purpose, the [ ` schema_version `
151151] [ link-config-schema-version ] value in the ` cube.js ` configuration options can
152152be specified as an asynchronous function:
153153
@@ -156,26 +156,26 @@ be specified as an asynchronous function:
156156module .exports = {
157157 schemaVersion: async ({ securityContext }) => {
158158 const schemaVersions = await (
159- await fetch (" http://your-api-endpoint/schemaVersion " )
159+ await fetch (" http://your-api-endpoint/schema_version " )
160160 ).json ();
161161
162162 return schemaVersions[securityContext .tenantId ];
163163 },
164164};
165165```
166166
167- [ link-config-schema-version ] : /reference/configuration/config#schemaversion
167+ [ link-config-schema-version ] : /reference/configuration/config#schema_version
168168
169169## Usage with COMPILE_CONTEXT
170170
171171The ` COMPILE_CONTEXT ` global object can also be used in conjunction with async
172- schema creation to allow for multi-tenant deployments of Cube.
172+ data model creation to allow for multi-tenant deployments of Cube.
173173
174174In an example scenario where all tenants share the same cube, but see different
175175dimensions and measures, you could do the following:
176176
177177``` javascript
178- // model/cubes/DynamicSchema .js
178+ // model/cubes/DynamicDataModel .js
179179const fetch = require (" node-fetch" );
180180import {
181181 convertStringPropToFunction ,
@@ -223,7 +223,7 @@ asyncModule(async () => {
223223
224224When using multiple databases, you'll need to ensure you set the
225225[ ` data_source ` ] [ ref-schema-datasource ] property for any asynchronously-created
226- schemas , as well as ensuring the corresponding database drivers are set up with
226+ data models , as well as ensuring the corresponding database drivers are set up with
227227[ ` driverFactory() ` ] [ ref-config-driverfactory ] in your [ ` cube.js ` configuration
228228file] [ ref-config ] .
229229
@@ -235,7 +235,7 @@ For an example scenario where data models may use either MySQL or Postgres
235235databases, you could do the following:
236236
237237``` javascript
238- // model/cubes/DynamicSchema .js
238+ // model/cubes/DynamicDataModel .js
239239const fetch = require (" node-fetch" );
240240import {
241241 convertStringPropToFunction ,
0 commit comments