Skip to content
Pure functional wrapper for RocksDB
Scala
Branch: master
Clone or download
Latest commit d0339a0 Sep 8, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
circe/src
core/src
examples/src/main
mules/src
project
.gitignore
.scalafmt.conf
CODE_OF_CONDUCT.md
LICENSE
README.md
build.sbt
version.sbt

README.md

rocks4s

Pure functional wrapper for RocksDB


Features

Frontends
Serialization
  • Avro
  • Circe
  • Protocol Buffers
Persistence
  • AWS S3
  • Azure Blob Storage
  • GCP Cloud Storage
Distributed Data
  • etcd
  • Consul

Usage

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.

You can’t perform that action at this time.