Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
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 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 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 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 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 diff a specific object or database branch
How to use the TerminusDB and TerminusCMS collaboration features using the JavaScript Client