3 ms·
Is there a library for Scala that is as powerful as Persistent with Esqueleto in Haskell? Persistent is a DSL for the database model and Esqueleto is a library
by oever 11y ago
Is there a library for Scala that is as powerful as Persistent with Esqueleto in Haskell? Persistent is a DSL for the database model and Esqueleto is a library for writing SQL that is validated against the database model at compile time.
http://www.yesodweb.com/book/sql-joins http://www.yesodweb.com/book/sql-joins
- lmm 11y agoHow is the article not exactly that? (The DSL for the model here is just Scala case class declarations, but they make a pretty good DSL for such things)
- virtualwhys 11y agoAs powerful as Persistent with Esqueleto? Slick, Squeryl, Quill, sqlTyped, probably others. Scala's type safe query dsl story is exceptionally good (I'd go so far as to say unrivaled, but working in Scala I'm biased). 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 ;-) [1] http://www.haskellforall.com/#databases-and-data-stores http://www.haskellforall.com/#databases-and-data-stores
- tome 11y ago> Esqueleto offically supports a single database, Postgres. This is not so. It supports at least persistent-mysql, persistent-postgresql, persistent-sqlite, according to https://github.com/prowdsponsor/esqueleto/ https://github.com/prowdsponsor/esqueleto/ Perhaps you are thinking of Opaleye, which does only support Postgres.
- lmm 11y agoI fear JDBC is actually holding Scala database access back. It's fundamentally blocking and just generally not a nice API, but because it's so established better alternatives can't gain any traction.