A simple key-value store based on Git repository. Get all the benefits of a Git repo such as revision history and tracking changes per user on a data store. These features are especially useful for storing and managing configuration files that are accessed and modified by multiple users/applications.
GitStore gitStore = new GitStore("/tmp/test-db");
String content = "A new document to store into GitStore";
String docname = "document-1";
gitStore.connect("arun", "[email protected]");
gitStore.put(docname, content, "inserted new document into git store.");
$cd /tmp/test-db
$git log
commit 03c8528435ada5e552ba561b4d69b3d3bad9b48d
Author: arun <[email protected]>
Date: Thu Nov 9 12:18:54 2017 -0600
inserted new document into git store.
gitStore.get(docname)
A new document to store into GitStore
String content = "Test test Test test";
String docname = "test-doc";
DBPartition partName = new DBPartition("part/1");
gitStore.connect("arun", "[email protected]");
gitStore.inPartition(partName).put(docname, content, "created for testing");
String content = gitStore.inPartition(partName).get(docname);
gitStore.inPartition(partName).delete(docname, "removing file.");
gitStore.dropPartitionTree(partName, "dropping partition after testing.");
<dependency>
<groupId>com.github.arun1729</groupId>
<artifactId>gitstore</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<repository>
<id>maven-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>