Simple method to consolidate boilerplate code for using scalasql and upickle libraries together #49
samikrc
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Recently I was trying to consolidate some boilerplate code to a Helper class so that a Scala 3 enum type can be used easily with both scalasql package and ujson package. The context here is that I had a bunch of case classes representing various database tables, and they have multiple enum fields in them. I also needed to read/write the same class to and from JSON as well.
Here is a way in which I was able to do this. Hope this helps.
Without this helper class, I have to replicate this same code for each of the enums.
Beta Was this translation helpful? Give feedback.
All reactions