https://github.com/kaizen-solutions/virgil-kyo
use Cassandra via Virgil with Kyo
https://github.com/kaizen-solutions/virgil-kyo
effects fp functional-programming kyo scala scala3 virgil
Last synced: 5 months ago
JSON representation
use Cassandra via Virgil with Kyo
- Host: GitHub
- URL: https://github.com/kaizen-solutions/virgil-kyo
- Owner: kaizen-solutions
- License: mpl-2.0
- Created: 2024-05-19T19:45:47.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-07-14T16:31:59.000Z (11 months ago)
- Last Synced: 2025-12-27T04:21:46.397Z (6 months ago)
- Topics: effects, fp, functional-programming, kyo, scala, scala3, virgil
- Language: Scala
- Homepage:
- Size: 40 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Virgil-Kyo
_Virgil is a functional Cassandra client built using Kyo, Magnolia and the Datastax 4.x Java drivers for Scala 3_
This project allows you to use [Virgil, the Cassandra client](https://github.com/kaizen-solutions/virgil) with [Kyo, the next generation toolkit for Scala 3](https://github.com/getkyo/kyo)


## Quickstart
```scala
libraryDependencies += "io.kaizen-solutions" %% "virgil-kyo" % ""
```
## Example
Here's an example of how to represent a workflow that inserts some data into a Cassandra table and then queries it back out:
```scala
import io.kaizensolutions.virgil.*
import io.kaizensolutions.virgil.codecs.*
import io.kaizensolutions.virgil.cql.*
import kyo.*
val program: Unit < (Env[CQLExecutor] & Async) =
val one = 1
val two = 2
val Alice = "Alice"
val Bob = "Bob"
val insertAlice = cql"INSERT INTO example (id, info) VALUES ($one, $Alice)".mutation
val insertBob = cql"INSERT INTO example (id, info) VALUES ($two, $Bob)".mutation
val query = cql"SELECT id, info FROM example".query[ExampleRow]
for
_ <- CQLExecutor.executeMutation(insertAlice)
_ <- CQLExecutor.executeMutation(insertBob)
(aliceAndBob, _) <- CQLExecutor.execute(query).run
yield ()
```