Quill – Compile-Time Language Integrated Query for Scala
getquill.io
getquill.io
Don't forget JDBC, Haskell is in the stone ages on this front. Like the JVM so much engineering has gone into JDBC, and all major database vendors have drivers for it. Not the case for Haskell, and even if it were, Esqueleto offically supports a single database, Postgres.
Haskellers in the know are well aware of deficiencies in this area[1]. Perhaps down the road things will change, but for now I couldn't help but rofl at the question ;-)
This is not so. It supports at least persistent-mysql, persistent-postgresql, persistent-sqlite, according to https://github.com/prowdsponsor/esqueleto/
Perhaps you are thinking of Opaleye, which does only support Postgres.
This is pretty similar in functionality to Slick. From reading the docs, it seems like it reduces some of the boilerplate (eg. in Slick you need to define both case classes and tables) but at the cost of potentially less customization.
Additionally, while Slick has a layer that you can use to actually create your database tables, this appears to be query layer only. That isn't a problem, I think. I found Slicks ddl stuff was mostly an antipattern in production (you should use an actual migration framework).
Another big advantage Quill has over slick is how easy it is to see the resulting query.
Partly the problem is there is no good defacto Record implementation in Scala so the library makers are not yet taking this seriously. There are few competing (?) that I've been looking at, one by cvogt here: https://github.com/cvogt/compossible and one called Scala records here: https://github.com/scala-records/scala-records
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.
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.
There's no "one size fits all". If quill's abstraction level is not enough for your domain, I suggest trying out http://activate-framework.org.