Skip to content

Releases: kaizen-solutions/virgil

Release for ZIO 2.0.4

27 Nov 22:38
Compare
Choose a tag to compare

Updates to underlying libraries

Release for ZIO 2.0.0

24 Jun 19:42
Compare
Choose a tag to compare

Virgil now supports ZIO 2.0

  • Underlying Cassandra metrics have been exposed (Thanks to @narma)

Expose metrics [zio1]

26 Jun 16:24
Compare
Choose a tag to compare

Thanks to @narma for exposing metrics

Add stripMargin to CqlInterpolatedString

19 Jun 20:38
Compare
Choose a tag to compare

We've added stripMargin which only works on the string portions of the cql query

 val query =
            cql"""SELECT id, name, persons
                 |FROM persons
                 |WHERE id = ${1} AND name = ${"cal"}""".stripMargin
// SELECT id, name, persons 
// FROM persons 
// WHERE id = :param0 AND name = :param1

Add stripMargin to CqlInterpolatedString

19 Jun 20:38
Compare
Choose a tag to compare

We've added stripMargin which only works on the string portions of the cql query

 val query =
            cql"""SELECT id, name, persons
                 |FROM persons
                 |WHERE id = ${1} AND name = ${"cal"}""".stripMargin
// SELECT id, name, persons 
// FROM persons 
// WHERE id = :param0 AND name = :param1

Bugfix for ZIO 2

10 Jun 17:51
Compare
Choose a tag to compare

Fixes the counter syntax and a CQL rendering bug pertaining to counter columns.

Here's some example usage

UpdateBuilder(tableName).set(Likes += in.likes).where(Id === in.id).build

Bugfix for ZIO 1

10 Jun 17:51
Compare
Choose a tag to compare

Fixes the counter syntax and a CQL rendering bug pertaining to counter columns.

Here's some example usage

UpdateBuilder(tableName).set(Likes += in.likes).where(Id === in.id).build

ZIO 2.0.0-RC6 support

03 May 19:49
Compare
Choose a tag to compare
ZIO 2.0.0-RC6 support Pre-release
Pre-release
  • select has been rewritten atop ZChannels to reduce allocations and improve performance
  • users of the API get better error information thanks to making use of Trace
  • Upgrade to ZIO 2.0.0-RC6

Scala 3

22 Apr 21:31
Compare
Choose a tag to compare

Virgil now has support for Scala 3. Codecs only have semi-automatic derivation but we'll get there 😸

final case class CursorExampleRow(
    id: Long,
    name: String,
    age: Short,
    @CqlColumn("may_be_empty") mayBeEmpty: Option[String],
    @CqlColumn("addresses") pastAddresses: Chunk[CursorUdtAddress]
  )

  object CursorExampleRow {
    given cqlRowDecoderForCursorExampleRow: CqlRowDecoder.Object[CursorExampleRow] =
      CqlRowDecoder.derive[CursorExampleRow]

    val tableName = "cursorspec_cursorexampletable"

    def truncate: CQL[MutationResult] = CQL.truncate(tableName)

    def insert(row: CursorExampleRow): CQL[MutationResult] =
      InsertBuilder(tableName)
        .values(
          "id"           -> row.id,
          "name"         -> row.name,
          "age"          -> row.age,
          "addresses"    -> row.pastAddresses,
          "may_be_empty" -> row.mayBeEmpty
        )
        .build

    def select(id: Long): CQL[Row] = {
      val cql = cql"SELECT * FROM " ++ tableName.asCql ++ cql" WHERE id = $id"
      cql.query
    }
  }

  final case class CursorUdtAddress(street: String, city: String, state: String, zip: String, note: CursorUdtNote)
  object CursorUdtAddress {
    given cqlUdtValueDecoderForCursorUdtAddress: CqlUdtValueDecoder.Object[CursorUdtAddress] =
      CqlUdtValueDecoder.derive[CursorUdtAddress]

    given cqlUdtValueEncoderForCursorUdtAddress: CqlUdtValueEncoder.Object[CursorUdtAddress] =
      CqlUdtValueEncoder.derive[CursorUdtAddress]
  }

  final case class CursorUdtNote(data: String, ip: InetAddress)
  object CursorUdtNote {
    given cqlUdtValueDecoderForCursorUdtNote: CqlUdtValueDecoder.Object[CursorUdtNote] =
      CqlUdtValueDecoder.derive[CursorUdtNote]

    given cqlUdtValueEncoderForCursorUdtNote: CqlUdtValueEncoder.Object[CursorUdtNote] =
      CqlUdtValueEncoder.derive[CursorUdtNote]
  }

ZIO 2.0 RC5 support

30 Apr 22:23
Compare
Choose a tag to compare
ZIO 2.0 RC5 support Pre-release
Pre-release

This release supports the latesrt version of ZIO 2.0 which is RC5 at the time. ZManaged and Has are deleted and we exclusively rely on Scopes to manage resources (like CqlSession and CQLExecutor).