Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 1.49 KB

README.md

File metadata and controls

37 lines (28 loc) · 1.49 KB

Scassandra

Build Status Coverage Status Codacy Badge Version License: MIT

Cassandra client in scala - wrapper over java client

Example

import com.evolutiongaming.scassandra._

val config = CassandraConfig.Default
val session = for {
  cluster <- CassandraCluster.of[IO](config, clusterId = 0)
  session <- cluster.connect
} yield session

val name = for {
  resultSet <- session.use { session => session.execute("SELECT name FROM users") }
} yield {
  val row = resultSet.one()
  row.decode[String]("name")
}

name.unsafeRunSync()

Setup

addSbtPlugin("com.evolution" % "sbt-artifactory-plugin" % "0.0.2")

libraryDependencies += "com.evolutiongaming" %% "scassandra" % "3.2.1"