I've got a Postrgres not null varying character column which I am hoping to map to a simple type-safe wrapper type, e.g.
case class CustomerId(value: String). However the database column has been set up with a default value, e.g.
"000000" which I cannot change. The generated code source for the associated row case class however generates something like case class SalesRow(..., customerId: CustomerId = "000000", ...) and this clearly will generate a compile error as the base and wrapped type are not the same. The row column type is right, just not the Scala default value. So, as I specifically do not want to write any auto-conversion from String to CustomerId, what's the best way forward?
I presume the correct solution is to override the row member generation process somehow, to have the column default value wrapped in the wrapper class, but I haven't found it particularly straightforward to see how to do that. Any functioning example would be most welcome. Actually, I think this is arguably a bug or at least an oversight.
Alternatively, a way to suppress the generation of the Scala default value entirely would be acceptable, as I can easily work around that in my Scala code.
Thanks for any input!
S.