-
I am trying to work out a case class which can be used for JSON parsing (using json/upickle) and then eventually writing to a database (using scalasql). Essentially the flow is something like this: I have defined the case class like so, before introducing the scalasql related stuff:
The above construct works fine. Now I am trying to convert this case class so that I can use it for DB interaction as well. The new case class looks like this:
However when I put this:
Things error out. How do I achieve this, if it is possible? I could not find an example for this, but I would think this as a pretty common use case! Thanks for any pointer - love the libraries in the ecosystem! Best. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Can you try using a normal ScalaSql |
Beta Was this translation helpful? Give feedback.
-
Thanks - yes that works! |
Beta Was this translation helpful? Give feedback.
-
If you can link this example from scalasql page as well, that would be helpful for folks who are just starting off with scalasql. |
Beta Was this translation helpful? Give feedback.
Can you try using a normal ScalaSql
case class Foo[T[_]]
, and define the upickle seriaizer viaimplicit def rw: upickle.default.ReadWriter[Foo[Sc]] = macroRw[Foo[Sc]]