levelkt alternatives and similar libraries
Based on the "Database" category.
Alternatively, view levelkt alternatives based on common mentions on social networks and blogs.
-
mapdb
MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap-memory. It is a fast and easy to use embedded Java database engine. -
DBFlow
A blazing fast, powerful, and very simple ORM android database library that writes database code for you. -
kotlin-gremlin-ogm
DISCONTINUED. Kotlin-gremlin-ogm is a type-safe object/graph mapping library for Gremlin enabled graph databases. -
kotlin-jpa-specification-dsl
This library provides a fluent DSL for querying spring data JPA repositories using spring data Specifications (i.e. the JPA Criteria API), without boilerplate code or a generated metamodel. -
zeko-sql-builder
Zeko SQL Builder is a high-performance lightweight SQL query library written for Kotlin language -
fluid-mongo
Kotlin coroutine support for MongoDB built on top of the official Reactive Streams Java Driver -
jds
Jenesis Data Store: a dynamic, cross platform, high performance, ORM data-mapper. Designed to assist in rapid development and data mining -
potassium-nitrite
Potassium Nitrite is a kotlin extension of nitrite database, an open source nosql embedded document store with mongodb like api.
CodeRabbit: AI Code Reviews for Developers
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of levelkt or a related project?
README
levelkt
LevelDB client for Kotlin and/or Java 8+.
Initially project aimed to provide an alternative API for fusesource/leveldbjni's JNI layer fixing some of the issues around thread-safety, inefficient backward traversal, absent key-only iteration, Java 8 support. Later on, leveldbjni was replaced with protonail/leveldb-jna.
Compared to pure leveldb-jna, levelkt
- hides the complexity associated with managing LevelDB Read/Write options
(while optimizing number of JNA calls), - provides convenient API for range/prefix queries, existence checks and
- makes it easier not to leak resources (you only need to close LevelDB, LevelDBSnapshot and LevelDBCursor instances (it will also warn you if you don't)).
Usage
<dependency>
<groupId>com.github.shyiko.levelkt</groupId>
<artifactId>levelkt</artifactId>
<version>0.1.0</version>
<!-- omit classifier below if you plan to use this library in koltin -->
<classifier>kalvanized</classifier>
</dependency>
(example) Kotlin
import com.github.shyiko.levelkt.jna.JNALevelDB
JNALevelDB("/tmp/0.leveldb").use { levelDB ->
levelDB.put("key1".toByteArray(), "value1".toByteArray())
levelDB.put("key2.1".toByteArray(), "value2.1".toByteArray())
levelDB.put("key2.2".toByteArray(), "value2.2".toByteArray())
levelDB.put("key3".toByteArray(), "value3".toByteArray())
assert(levelDB.get("key1".toByteArray())?.let { String(it) } == "value1")
assert(levelDB.keySlice("key".toByteArray(), offset = 1, limit = 2).map { String(it) } ==
listOf("key2.1", "key2.2"))
assert(levelDB.keySlice("key2".toByteArray(), "key3".toByteArray()).map { String(it) } ==
listOf("key2.1", "key2.2"))
assert(levelDB.keySliceByPrefix("key2".toByteArray()).map { String(it) } ==
listOf("key2.1", "key2.2"))
levelDB.keyCursor().use { cursor ->
assert(cursor.seek("key2".toByteArray())?.let { String(it) } == "key2.1")
assert(cursor.next()?.let { String(it) } == "key2.2")
}
// slice/sliceByPrefix/cursor look exactly the same as keySlice/keySliceByPrefix/keyCursor
// the only difference - they operate with LevelDBRecord instead of ByteArray
levelDB.batch {
put("key1".toByteArray(), "value1.updated".toByteArray())
del("key3".toByteArray())
}
levelDB.del("key1".toByteArray())
}
(example) Java 8+
import com.github.shyiko.levelkt.LevelDB;
import com.github.shyiko.levelkt.jna.JNALevelDB;
try (LevelDB levelDB = new JNALevelDB("/tmp/0.levedb")) {
levelDB.batch(batch -> batch
.put("key1".getBytes(), "value1".getBytes())
.put("key2.1".getBytes(), "value2.1".getBytes())
.put("key2.2".getBytes(), "value2.2".getBytes())
.put("key3".getBytes(), "value3".getBytes())
);
assert levelDB
.sliceByPrefix("key2".getBytes())
.stream()
.map(record -> new String(record.getKey()) + "=" + new String(record.getValue()))
.collect(Collectors.toList())
.equals(Arrays.asList("key2.1=value2.1", "key2.2=value2.2"));
}
Development
git clone https://github.com/shyiko/levelkt && cd levelkt
./mvnw # shows how to build, test, etc. project
Legal
All code, unless specified otherwise, is licensed under the MIT license.
Copyright (c) 2017 Stanley Shyiko.
*Note that all licence references and agreements mentioned in the levelkt README section above
are relevant to that project's source code only.