joeyh

past my sql gap decades

joeyh at

Last time I used SQL, it was 1998, I was writing web crud that had to use the databases set up by the company's DBA, and I hated it. Things are different now!

Now, I'm doing exploratory coding in preparation for building carefully targeted sql caching code for a git databranch.

I'm using sqlite, whose author I've had some good in-person chats with(!)

I'm using persistent to automatically generate type-safe mappings between my haskell code and the database. This is not an ORM; I luckily skipped entirely over the ORM dark years and right into what is still the future for most people. http://www.yesodweb.com/book/persistent

After writing one SELECT statement to be sure I remembered how, I'm using the Esqueleto DSL to write queries. This starts blowing your mind when you realize you don't need to tell it the tables to query from; that is inferred from the type of the result of your query. http://hackage.haskell.org/package/esqueleto-1.3.5/docs/Database-Esqueleto.html

Amitai Schleier likes this.

Could this be the Haskell killer app? Sounds awesome.

Claes Wallin (韋嘉誠) at 11 years ago

That's exactly how I've always felt about about ORM.

Mark Jaroski at 11 years ago

Wow. That Esqueleto code is nearly readable by mere mortals too.

Jeremiah C. Foster at 11 years ago