diff --git a/src/main/scala/com/ringcentral/cassandra4io/cql/Reads.scala b/src/main/scala/com/ringcentral/cassandra4io/cql/Reads.scala index e197ebe..2794a10 100644 --- a/src/main/scala/com/ringcentral/cassandra4io/cql/Reads.scala +++ b/src/main/scala/com/ringcentral/cassandra4io/cql/Reads.scala @@ -35,6 +35,7 @@ object Reads extends ReadsLowerPriority with ReadsLowestPriority { implicit val stringReads: Reads[String] = (row: Row, index: Int) => row.getString(index) implicit val doubleReads: Reads[Double] = (row: Row, index: Int) => row.getDouble(index) + implicit val floatReads: Reads[Float] = (row: Row, index: Int) => row.getFloat(index) implicit val intReads: Reads[Int] = (row: Row, index: Int) => row.getInt(index) implicit val longReads: Reads[Long] = (row: Row, index: Int) => row.getLong(index) implicit val byteBufferReads: Reads[ByteBuffer] = (row: Row, index: Int) => row.getByteBuffer(index) diff --git a/src/main/scala/com/ringcentral/cassandra4io/cql/package.scala b/src/main/scala/com/ringcentral/cassandra4io/cql/package.scala index 5452a9e..4b5f72e 100644 --- a/src/main/scala/com/ringcentral/cassandra4io/cql/package.scala +++ b/src/main/scala/com/ringcentral/cassandra4io/cql/package.scala @@ -276,6 +276,11 @@ package object cql { (statement.setDouble(index, value), index + 1) } + implicit val floatBinder: Binder[Float] = new Binder[Float] { + override def bind(statement: BoundStatement, index: Int, value: Float): (BoundStatement, Int) = + (statement.setFloat(index, value), index + 1) + } + implicit val intBinder: Binder[Int] = new Binder[Int] { override def bind(statement: BoundStatement, index: Int, value: Int): (BoundStatement, Int) = (statement.setInt(index, value), index + 1)