Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to main content
Data model editor provides the code-first experience for building and enhancing the data model of your semantic layer from within your web browser. Unlike the Visual Model editor, it provides the freedom to use all available data modeling features at the expense of a code-centric experience. Cube Cloud can create branch-based development API instances to quickly test changes in the data model in your frontend applications before pushing them into production.

Development Mode

In development mode, you can safely make changes to your project without affecting production deployment. Development mode uses a separate Git branch and allows testing your changes in Playground or via a separate API endpoint specific to this branch. This development API hot-reloads your data model changes, allowing you to quickly test API changes from your applications. To enter development mode, go to Model › IDE and click Dev mode in the top bar.
IDE top bar with the branch picker and the Dev mode button
If you are entering development mode from the main branch, you will be asked to choose an existing branch or create a new one. You can configure whether it’s possible to commit directly to the main branch in the deployment settings.
Enter development mode dialog with a new branch name and the Start dev mode button
When development mode is active, the top bar is highlighted, and the development API hot-reloads after any changes to the project. You can exit development mode by clicking × on Dev mode in the top bar. If you’ve been editing a data model and navigate away, Cube will warn you if there are any unsaved changes:
You have unsaved changes dialog with the Go back, Discard changes and Save changes buttons

Git integration

To add more Git branches to your deployment and/or switch between them, click the branch name in the top bar:
Branch picker with the list of branches and the Create branch from, Delete current branch and View all branches items
Speaking of Git branches, you can add and delete branches with the same switcher. Click Create branch from…, enter the branch name, and pick the branch to start from under Create from:
Create branch dialog with the Branch name and Create from fields
These branches are shared, meaning everyone who has access to the deployment can see and edit them. This makes them extremely useful for out-of-band experiments where you can quickly test things in Cube Cloud without having to go through a CI/CD process. Unused branches can also be deleted. Ensure you are already on the branch you want to delete, then open the switcher and click Delete current branch. Confirm with Delete branch. To delete the branch from GitHub too, check Also delete this branch from GitHub. To share a link to the branch you’re currently viewing, click the copy-link button next to the branch switcher. It copies the current URL with ?branch=<branch-name> appended; opening that link switches the recipient to the same branch.

Reviewing changes

To review the changes on a branch, switch the editor from Files to Changes. The Changes tab lists every changed file and shows a card with the diff for each file. If the branch can be compared with more than one branch, select the base in Compare with. To keep track of what you have already reviewed, select Viewed on a file card. The card folds, and the file moves out of the Not viewed list into the Viewed group. Viewed marks are personal: each user has their own on each branch. If a viewed file changes again, it shows Changed since viewed and returns to the Not viewed list. Its card shows only the changes made since you viewed the file, and a note on the card says so. Click Show all changes to see the full diff of the file, and Show only changes since viewed to switch back. If the version you viewed can’t be read, for example after a squash, the card shows all changes and says so.

Generating data model files

Visual Model is available on Premium and above plans. On other plans, you can generate data model files only when creating a new deployment.
You can generate data model files when creating a new deployment or at later moment. To open the data model wizard, go to Visual Model in development mode, click ⋮ in the top right corner, and select Generate data model:
More actions menu next to Save all in Visual Model, with the Generate data model item
It is safe to generate data model files for tables that already have matching cubes. In that case, existing files will be renamed by appending .backup to their names. You would also be able to review changes to files on the Changes tab:
Changes tab with a regenerated orders.yml file, its orders.yml.backup copy and the start of the diff