Please sign in to comment.
Use NumericTypeMapper for BigDecimal and Short. Related to issue #24.
A completely revamped DataTypeTest.testNumeric can test the different numeric types individually while ensuring they actually have a NumericTypeMapper and only running tests for supported types on each driver. This is the first test for BigDecimal so it uncovered some problems. We need to pick an arbitrary default scale and precision because they differ wildly across database systems. I chose 21,2 to get the full scale of scala.Long plus 2 extra digits of precision after the decimal point. SQLite and Access do not support decimal types, so there is a new capability BasicProfile.capabilities.typeBigDecimal to reflect this restriction. BasicProfile.capabilities.all was also missing some previously introduced capabilities (enabling these capabilities and thus the associated test cases fortunately did not turn up any regressions).
- Loading branch information
Showing with 38 additions and 44 deletions.
- +21 −35 slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/DataTypeTest.scala
- +4 −2 src/main/scala/scala/slick/driver/AccessDriver.scala
- +7 −5 src/main/scala/scala/slick/driver/BasicProfile.scala
- +1 −0 src/main/scala/scala/slick/driver/BasicTypeMapperDelegatesComponent.scala
- +3 −0 src/main/scala/scala/slick/driver/SQLiteDriver.scala
- +2 −2 src/main/scala/scala/slick/lifted/TypeMapper.scala