io.kaizensolutions.virgil.cql.ValueInCql.scala Maven / Gradle / Ivy
The newest version!
package io.kaizensolutions.virgil.cql
import io.kaizensolutions.virgil.codecs.CqlRowComponentEncoder
/**
* Represents a Scala value present in a CQL interpolated string which
* ultimately needs to be sent to Cassandra along with a query ValueInCql also
* has the sufficient capability to write the data into the underlying Datastax
* statement
*/
private[virgil] trait ValueInCql {
type ScalaType
def value: ScalaType
def writer: CqlRowComponentEncoder[ScalaType]
override def toString: String =
value.toString
}
object ValueInCql extends ValueInCqlInstances {
// Type Refinement
type WithScalaType[Sc] = ValueInCql { type ScalaType = Sc }
}