How to use TerminusDB and TerminusCMS' collaboration using the dashboard and clients
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
How to use the TerminusDB and TerminusCMS collaboration features using the JavaScript Client
How-to time travel to a specific commit
Assuming you have connected with the JavaScript Client, created a database, and made a few commits, you can time travel to inspect them to see what they looked like.
You can use the JS WOQL Client Library method to get a list of branch commits. This example uses paginationto get the last 10 commits starting from the branch head -
You can also get a list of commits from a specific timestamp. The timestamp can be obtained from the log -
An exampe response -
To travel back in time to a particular commit, you need to specify the commit ID in the JS woqlClient parameters. To obtain the commit ID, refer to the code snippet above. All your calls after will be made for this commit.
How-to use the JS Client to clone a database
Assuming you have connected with the JavaScript Client you can clone your database.
Cloning a database pulls down a full copy of all data at that point in time, including all document and schema versions.
If the database that you are cloning is not public, you need to provide an APIKey to the client setting the remoteAuth For more info visit the 'How to get your API key' page.
How to use the TerminusDB and TerminusCMS collaboration features using the TerminusCMS dashboard
How to Clone a Project using the TerminusCMS Dashboard
From the project home page, on the right, you will see the Clone Project
section.
You can clone the project with -
The same name to another team - choose this from the dropdown menu
A different name to another team
A different name to the same team
Press the Clone
button.
You will be directed to the cloned project. If you clone to a different team, you will also move teams.
Time travel to any previous commit using the TerminusCMS dashboard
It is possible in the TerminusCMS dashboard to time travel to any previous commit and examine the data and schema. This is particularly useful if you want to see what something looked like at a particular date, or if something has broken and you want to see when the last stable state was so you can revert back to it.
Time travel is each to do. From any screen when viewing a project (apart from the project home page), you will see a stopwatch symbol
in the top bar.
Select this and a panel will appear from the right.
Each commit in the list features the comments from the merged change request.
Travel back in time by selecting the button next to the commit you want to go back to.
The dashboard informs you that you are not on the latest version.
You can then go an inspect the data in your project and the schema to see what's changed.
Reset to a particular commit of a branch using the TerminusCMS dashboard.
To reset a branch of a database, or indeed main, navigate to the project home page, the first icon on the left that looks like a database.
Scroll down to the Manage Branches
section and selected Branches
.
Next to the branch you want to reset, select the ellipses symbol to see the branch options.
Choose the Reset
button.
Choose the commit you would like to reset to and copy the commit ID by selecting the clipboard icon. You can inspect commits using the time travel feature.
Paste the commit ID and press the Reset Branch
button.
How-to create a new branch in TerminusDB and TerminusCMS using the JavaScript Client
Assuming you have connected with the JavaScript Client and created a database you can then create a branch of your project.
Creating a branch is the same for TerminusDB and TerminusCMS. By default in TerminusDB or TerminusCMS you are working in the main branch.
Use this code to create a new branch starting from branch main head.
Now you are in the branch called mybranch
.
You can create a new branch starting from the mybranch
head
Get all of the database's branches in a list using a WOQL library method
Response example
How-to use the JS Client to reset a branch
Assuming you have created a database, and made a few commits, you can time travel to inspect them.
You may want to reset the branch to a specific commit. You will need your branch name and commit ID which can be obtained by time traveling.
The below code will rest your branch to a specific commit ID -
How-to use the JS WOQLClient to squash commits in your branch's history
Squashing allows you to combine multiple commits in your branch's history into a single commit.
An example response -
How to use the TerminusDB and TerminusCMS collaboration features using the JavaScript Client
How-to use the JS Client to diff a specific object or database branch
How-to create a new branch in TerminusDB and TerminusCMS using the Python Client
Assuming you have connected with the Python Client and created a database you can then create a branch of your project.
Creating a branch is the same for TerminusDB and TerminusCMS. By default in TerminusDB or TerminusCMS you are working in the main branch.
Use this code to create a new branch starting from branch main head.
If you add documents to the mybranch
, they won't end up in the main
branch unless you merge them.
Now you are in the branch called mybranch
.
You can create a new branch starting from the mybranch
head. Since we are checked out on the "mybranch" already, we can just create a new branch from there. It will have mybranch
as its parent.
Get all of the data product's branches in a list using a method
Response example
How-to use the Python Client to clone a database
This how-to will show how to clone a public database from TerminusCMS into your own TerminusCMS team.
Be sure to construct the Python client object first, and set the appropriate authentication token.
Check the TerminusCMS dashboard for a database that you want to clone. In this how-to, we will be using the Lego database as an example.
You now have the my_lego database cloned in your TerminusCMS team.
To verify whether the database has been successfully cloned, you can run:
How to reset to a specific commit using the Python Client
Assuming you have connected with the Python Client, created a database, and made a few commits, you can reset the HEAD of a database to a particular commit. Just like you would do in git
with git reset
.
You can use the Python Client Library method to get a list of branch commits. This example uses pagination to get the last commits starting from the branch head -
A response example will be a list of objects like this:
To reset the HEAD of your database to a particular commit, you need to get the identifier of a particular commit. To obtain the identifier, refer to the code snippet above.
Time travel through your database history to a specific commit
You can use the Python Client Library method to get a list of branch commits. This example uses pagination to get the last 10 commits starting from the branch head -
A response example will be a list of objects like this:
To travel back in time to a particular commit, you need to specify the commit ID in the ref property. To obtain the commit ID, refer to the code snippet above. All your calls after will be made for this commit.
Assuming you have , created a database, and made a few commits, you can time travel to inspect them to see what they looked like.
How to branch projects using the TerminusCMS dashboard
The TerminusCMS dashboard enables you to branch projects. To do this, choose the team and project you want to branch. You will be directed to the project home page. This is where you can branch it.
Scroll down to see the manage branch
section.
Each project can have one or more branches, the default is called main. Each branch contains a snapshot of the data as it was at the time of branching. This is useful for experimenting or providing data to other teams when you want to keep them away from main.
Click the new branch
button.
Give the branch and ID.
You then have two choices:
Branch from the current head to include all of the data
Create an empty branch
Click new branch
to create it.
You will then be switched to that branch.
From the manage branch section use the ellipsis symbol next to the branches to switch between branches and main.
How to use the Python client to squash commits in your branch's history.
Squashing allows you to combine multiple commits in your branch's history into a single commit. This how-to assumes that you are connected to a database already.
The result will contain the new commit id. You can use it to reset the HEAD to the new squashed commit.
quash the commits of a branch or main into one large commit using the TerminusCMS dashboard.
To squash a branch of a database, or indeed main, navigate to the project home page, the first icon on the left that looks like a database.
Scroll down to the Manage Branches
section and selected Branches
.
Next to the branch you want to squash, select the ellipses symbol to see the branch options.
Choose the Squash
button.
Give the operation a description and press the Squash Branch
button.
Be wary as squashing a project will result in the commit history being lost