@@ -276,6 +276,17 @@ module.exports = {
276276
277277## Running syncs
278278
279+ Cube automatically runs configured syncs every time a [ new build is deployed] ( #on-build ) .
280+ Additionally, you can configure syncs to run [ on schedule] ( #on-schedule ) .
281+ Finally, you can [ manually] ( #manually ) trigger any sync to run.
282+
283+ During the sync, Cube will either create from scratch or update a database in
284+ the corresponding BI tool and the data model associated with it. Syncing a
285+ branch in [ development mode] [ ref-dev-mode ] will create a separate database,
286+ leaving the one associated with the production branch intact.
287+
288+ ### On build
289+
279290When the data model is updated, all configured syncs will automatically run.
280291
281292<WarningBox >
@@ -288,17 +299,80 @@ data model is updated dynamically for your Cube Cloud account.
288299
289300</WarningBox >
290301
302+ ### On schedule
303+
304+ You can use the ` scheduleInterval ` option to specify the interval for running
305+ a particular sync on schedule. This is useful for cases when you expect that
306+ a BI tool might be temporarily unavailable via its API; the next scheduled sync
307+ will likely succeed anyway.
308+
309+ <CodeTabs >
310+
311+ ``` python
312+ from cube import config
313+
314+ @config (' semantic_layer_sync' )
315+ def semantic_layer_sync (ctx : dict ) -> list[dict ]:
316+ return [
317+ {
318+ ' type' : ' superset' ,
319+ ' name' : ' Superset Sync' ,
320+ ' active' : False ,
321+ ' config' : {
322+ 323+ ' password' : ' 4dceae-606a03-93ae6dc7' ,
324+ ' url' : ' superset.example.com' ,
325+ ' database' : ' Cube Cloud: staging-deployment' ,
326+ ' scheduleInterval' : ' every 10 minutes'
327+ }
328+ }
329+ ]
330+ ```
331+
332+ ``` javascript
333+ module .exports = {
334+ semanticLayerSync : ({ securityContext }) => {
335+ return [
336+ {
337+ type: " superset" ,
338+ name: " Superset Sync" ,
339+ active: false ,
340+ config: {
341+ 342+ password: " 4dceae-606a03-93ae6dc7" ,
343+ url: " superset.example.com" ,
344+ database: " Cube Cloud: staging-deployment" ,
345+ scheduleInterval: " every 10 minutes"
346+ }
347+ }
348+ ]
349+ }
350+ }
351+ ```
352+
353+ </CodeTabs >
354+
355+ The ` scheduleInterval ` option accepts values in the ` every [number] [period] `
356+ format, where ` [number] ` can be any positive integer, and ` [period] ` can be
357+ any value from the following list: ` day ` , ` hour ` , ` minute ` , or ` days ` , ` hours ` ,
358+ ` minutes ` .
359+
360+ <InfoBox >
361+
362+ Development instances and [ auto-suspended] [ ref-auto-sus ] production clusters
363+ can't run syncs on schedule.
364+
365+ </InfoBox >
366+
367+ ### Manually
368+
291369You can also run a sync manually by navigating to the <Btn >Semantic Layer
292370Sync</Btn > tab on the <Btn >BI Integrations</Btn > page and clicking <Btn >Start
293- Sync</Btn > next to a relevant sync.
371+ Sync</Btn > next to a relevant sync. This is convenient for working in the
372+ [ development mode] [ ref-dev-mode ] .
294373
295374<Screenshot src = " https://ucarecdn.com/e48cef02-cc89-466d-a293-11a04aacb116/" />
296375
297- During the sync, Cube will either create from scratch or update a database in
298- the corresponding BI tool and the data model associated with it. Syncing a
299- branch in [ development mode] [ ref-dev-mode ] will create a separate database,
300- leaving the one associated with the production branch intact.
301-
302376## Viewing history
303377
304378You can view the history of runs for a particular sync by navigating to
@@ -328,3 +402,4 @@ on, i.e., your development mode branch, shared branch, or main branch.
328402[ ref-config-schemaversion ] : /reference/configuration/config#schemaversion
329403[ ref-workspace-sls ] : /workspace/bi-integrations
330404[ ref-dev-mode ] : /product/workspace/dev-mode
405+ [ ref-auto-sus ] : /product/deployment/cloud/auto-suspension
0 commit comments