4 ms·
Interesting! I was actually considering implementing a record system when designing quill, but wasn't sure if it'd be convenient to the users since it requires
by fwbrasil 11y ago
Interesting! I was actually considering implementing a record system when designing quill, but wasn't sure if it'd be convenient to the users since it requires learning one more DSL.
Currently, quill provides two alternatives:
1. Select tuples instead of case classes
2. As the mapping case classes are simple to create, it's possible to define an additional one only with the fields the user wants to select in the query.
This means that's possible select any subset of the database structure. I still wonder if records would be a better solution though.
- Ciantic 11y agoI think records are better solution than tuples in most cases, they provide type safety, contain the field names and auto-completion for fields. Scala-records makes casting records back to case classes easy. Defining tables as case classes is pretty neat, but option to get Records out of queries would be preferred. Though I can't figure out which Scala record implementation is going to prevail, making the choice hard, but creating own record type is probably not the way.