> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cube.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Data Model IDE

> Covers the browser code editor for full data modeling features, branch-based dev APIs, and testing model changes before they reach production traffic.

Data model editor provides the code-first experience for building and enhancing the
[data model][ref-data-modeling] of your semantic layer from within your web browser.

Unlike the [Visual Modeler][ref-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.

[Loom video](https://www.loom.com/embed/101b6291b0ba4d1d8982faa3b8c5bd55)

## 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, navigate to the **Data model** screen and
click **Dev mode**.

![Entering dev mode](https://ucarecdn.com/a35aefc4-8065-4641-a79d-d441d2789c55/)

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.

![Entering dev mode modal](https://ucarecdn.com/68ed5627-ab7f-4d16-8dc4-90e48c0e6216/)

When development mode is active, the status of the development API will be shown
at the top of the screen. After any changes to the project, the API
will hot-reload, and the API status will indicate when it's ready.

You can exit development mode by clicking **Dev mode X** in the purple banner. If
you've been editing a data model and navigate away, Cube Cloud will warn you if
there are any unsaved changes:

![Unsaved changes warning modal](https://ucarecdn.com/67b8e943-0043-4398-84fc-91d83765ed10/)

## Git integration

To add more Git branches to your Cube Cloud deployment and/or switch between
them, click the branch name in the status bar:

![Branch switcher](https://ucarecdn.com/a3ea164f-b93c-4c83-b7a3-697dd025b74a/)

Speaking of Git branches, you can add and delete branches with the
same switcher; click **Add Branch** and enter a name for the new branch
in the popup:

![Create a new branch](https://ucarecdn.com/15ea528f-4a54-40a1-83c7-2f67738a3e8b/)

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

You can generate data model files when [creating a new
deployment][ref-creating-deployment] or at later moment. To open the data model
wizard, click on the **...** button on the right and select **Generate
data model**:

![](https://ucarecdn.com/0f9684c2-a7f5-48a2-9fac-32e050beba5d/)

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][ref-reviewing-changes] to files on
the **Changes** tab:

![](https://ucarecdn.com/a8d53348-8441-41f3-969c-df46d41d78b6/)

[ref-data-modeling]: https://docs.cube.dev/docs/data-modeling/overview.md

[ref-creating-deployment]: https://docs.cube.dev/admin/deployment.md#creating-a-new-deployment

[ref-visual-model]: https://docs.cube.dev/docs/data-modeling/visual-modeler.md

[ref-reviewing-changes]: #reviewing-changes


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.