Open TobiasPfeifer opened 2 years ago
@TobiasPfeifer numeric[]
was bind to List[BigDecimal]
, and float8[]
was bind to List[Double]
.
But pg
can accept double[]
to numeric[]
, so the insert
with List[Double]
is ok.
You can change the declaration of test numeric[]
to test float8[]
, to keep them consistent.
I had the same issue. When I want to use BigDecimal
instead, I get the following compile error:
could not find implicit value for parameter tt: slick.ast.TypedType[Option[List[BigDecimal]]]
def valueNumericArray = column[Option[List[BigDecimal]]]("value_numeric_array")
Declaration looks like: def valueNumericArray = column[Option[List[BigDecimal]]]("value_numeric_array")
slick-pg version: 0.20.3 slick version: 3.3.3
A table with a column of type
numeric[]
that is defined ascolumn[List[Double]]
will insertList[Double]
for that column just fine. However, it will not read aList[Double]
but aList[BigDecimal]
at runtime.This will result in a
ClassCastException
when trying to access the values ofList[Double]
:ERROR: java.lang.ClassCastException: class java.math.BigDecimal cannot be cast to class java.lang.Double (java.math.BigDecimal and java.lang.Double are in module java.base of loader 'bootstrap')
VPostgresProfile.api._
andVPostgresProfile
is in scope:workaround: