Skip to content

Commit

Permalink
Add scala.math.BigDecimal JdbcDecoder instance
Browse files Browse the repository at this point in the history
  • Loading branch information
guizmaii committed Oct 25, 2023
1 parent 95cf951 commit ffd0709
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/main/scala/zio/jdbc/JdbcDecoder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ object JdbcDecoder extends JdbcDecoderLowPriorityImplicits {
implicit val stringDecoder: JdbcDecoder[String] = JdbcDecoder(_.getString)
implicit val booleanDecoder: JdbcDecoder[Boolean] = JdbcDecoder(_.getBoolean)
implicit val bigDecimalDecoder: JdbcDecoder[java.math.BigDecimal] = JdbcDecoder(_.getBigDecimal)
implicit val bigDecimalDecoderScala: JdbcDecoder[scala.math.BigDecimal] =
bigDecimalDecoder.map(scala.math.BigDecimal.javaBigDecimal2bigDecimal)
implicit val shortDecoder: JdbcDecoder[Short] = JdbcDecoder(_.getShort)
implicit val floatDecoder: JdbcDecoder[Float] = JdbcDecoder(_.getFloat)
implicit val byteDecoder: JdbcDecoder[Byte] = JdbcDecoder(_.getByte)
Expand Down Expand Up @@ -546,6 +548,7 @@ object JdbcDecoder extends JdbcDecoderLowPriorityImplicits {

trait JdbcDecoderLowPriorityImplicits {
import zio.schema._

import java.sql.{ Types => SqlTypes }

private def getBinary(binary: InputStream): Chunk[Byte] = {
Expand Down

0 comments on commit ffd0709

Please sign in to comment.