alf-tool / try-alf

www.try-alf.org
7 stars 0 forks source link

Some Inspirations #2

Open CMCDragonkai opened 9 years ago

CMCDragonkai commented 9 years ago

Hey, this looks really cool. I've been researching about embeddable type-safe SQL DSL that made more sense than the current SQL standard. Especially something that has more expression-like notation and could give me better error reporting.

Have you seen Haskell's Opaleye or HaskellDB? They are both functional style DSLs but of course with an emphasis on type safety as well:

  1. https://github.com/tomjaguarpaw/haskell-opaleye/blob/master/Doc/Tutorial/TutorialBasic.lhs
  2. http://chrisdone.com/posts/haskelldb-tutorial
  3. http://sqlkorma.com/

What's your opinion on them, and how do you see alf fitting in? Will we be able to see databases using these query languages one day?

Also your introduction blog post reminded me of lenses and bidirectional transformation. Something like augeas: http://augeas.net/

blambeau commented 9 years ago

Hi!

Thanks for the links. I do know HaskellDB and SQLKorma, not Opaleye. I sometimes use Haskell (not very often) and almost never Clojure.

I would say that at first glance Alf is to Ruby what HaskellDB is to Haskell, but type safety of course (which has both advantages and drawbacks, like static vs. dynamic languages). I can't really compare them further as I don't use HaskellDB in any serious project, while I do use Alf in them. But I think the objectives are mostly the same.

SQLKorma seems a query builder, so it's tight to SQL databases isn't? Alf is not. Do those three approaches support joining SQL tables and .csv files for example? I think that's a major advantages of "Relations as First Class" (see try-alf's blog) you can abstract from where the data comes from.

I do hope we will eventually have those as query languages! Well, things are a little bit more complicated than that, but yes, I do think the logical level of databases should be drastically improved. Those libraries show one way. Let's hope that the NoSQL/BigData movement will bring the money for at least one new "relational" project to pop out :-)

CMCDragonkai commented 9 years ago

Yep I continued reading about Alf and it looks well designed. I'll keep tabs on the project. One of my other gripes is append only databases, wish it was easily supported.