Skip to content

Commit

Permalink
Update CqlPrimitiveEncoder.scala
Browse files Browse the repository at this point in the history
Use the right constraint in `encodePrimitiveByIndex`. In case of `TupleValue` it implements `SettableByIndex<TupleValue>`. This changes the constraint in `encodePrimitiveByIndex` to use `SettableByIndex` instead of `SettableByName`
  • Loading branch information
serhiip authored and calvinlfer committed Nov 24, 2023
1 parent 1ce8877 commit 76eb3d4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.kaizensolutions.virgil.codecs

import com.datastax.oss.driver.api.core.`type`._
import com.datastax.oss.driver.api.core.data.CqlDuration
import com.datastax.oss.driver.api.core.data.SettableByName
import com.datastax.oss.driver.api.core.data.{SettableByName, SettableByIndex}
import com.datastax.oss.driver.api.core.data.UdtValue

import scala.jdk.CollectionConverters._
Expand Down Expand Up @@ -88,7 +88,7 @@ object CqlPrimitiveEncoder {
structure.set(fieldName, driverValue, other.driverClass)
}

def encodePrimitiveByIndex[Structure <: SettableByName[Structure], Scala](
def encodePrimitiveByIndex[Structure <: SettableByIndex[Structure], Scala](
structure: Structure,
index: Int,
value: Scala
Expand Down

0 comments on commit 76eb3d4

Please sign in to comment.