https://github.com/evolution-gaming/scassandra
Cassandra client in scala
https://github.com/evolution-gaming/scassandra
cassandra cats cats-effect client scala
Last synced: 9 months ago
JSON representation
Cassandra client in scala
- Host: GitHub
- URL: https://github.com/evolution-gaming/scassandra
- Owner: evolution-gaming
- License: mit
- Created: 2018-10-19T17:55:53.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2025-04-03T10:18:29.000Z (9 months ago)
- Last Synced: 2025-04-23T00:16:19.753Z (9 months ago)
- Topics: cassandra, cats, cats-effect, client, scala
- Language: Scala
- Size: 261 KB
- Stars: 14
- Watchers: 8
- Forks: 7
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Scassandra
[](https://github.com/evolution-gaming/scassandra/actions?query=workflow%3ACI)
[](https://coveralls.io/github/evolution-gaming/scassandra?branch=master)
[](https://app.codacy.com/gh/evolution-gaming/scassandra/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[](https://evolution.jfrog.io/artifactory/api/search/latestVersion?g=com.evolutiongaming&a=scassandra_2.13&repos=public)
[](https://opensource.org/licenses/MIT)
### Cassandra client in scala - wrapper over java client
## Example
```scala
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
```scala
addSbtPlugin("com.evolution" % "sbt-artifactory-plugin" % "0.0.2")
libraryDependencies += "com.evolutiongaming" %% "scassandra" % "3.2.1"
```