The YttriumDB Java API is the official Java API for the YttriumDB database.
You can import the API via the JitPack repository.
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.aredblock:YttriumDB:Tag'
}
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.aredblock</groupId>
<artifactId>YttriumDB</artifactId>
<version>Tag</version>
</dependency>
</dependencies>
With the YttriumClient you can enter or load columns into the database using the push() and pop() methods.
Upload to the database:
//[...]
final var client = YttriumClient.builder()
.key("<your_key>")
.build();
final var column = Column.of(
Row.of("User1", "user1@example.com")
);
client.push(columnUser, demoColumn);
//[...]
Loading columns from the database:
//[...]
final var client = YttriumClient.builder()
.key("<your_key>")
.build();
final var loadedColumn = yttriumClient.pop(columnUser);
loadedColumn.getColumn().getRows().forEach(row -> {
System.out.println(row.getKey() + "=" + row.getValue());
});
//[...]