Pure functional wrapper for RocksDB
- Avro
- Circe
- Protocol Buffers
- AWS S3
- Azure Blob Storage
- GCP Cloud Storage
- etcd
- Consul
Construct a database instance and running operations:
import cats._
import cats.effect._
import cats.implicits._
import rocks4s._
import org.rocksdb.Options
object Example extends IOApp {
def run(args: List[String]): IO[ExitCode] =
RocksDB[IO](".rocks", new Options().setCreateOnMissing(true))
.use { rocks =>
for {
_ <- rocks.put("foo", "bar")
v <- rocks.get("foo")
_ <- IO(println(s"Retrieved value $v"))
} yield ExitCode.Success
}
}
See the examples project for more thorough usage.