[Haskell-cafe] ORM for haskell?

Jeremy Shaw jeremy at n-heptane.com
Tue Jun 30 18:30:03 EDT 2009


At Tue, 30 Jun 2009 19:52:08 +0200,
Marc Weber wrote:

> Is there anyone interested in helping building a library which
> a) let's you define kind of model of you data
> b) let's you store you model in any backend (maybe a relational
>     database)
> c) does static checking of your queries at compilation time?

> Maybe this does already exist and I've missed it?

Happstack-state is close in many respects. Your persistent state can
basically be any haskell data type for which you could create
instances of Read/Show where, read . show == id. (Note, happstack
state doesn't actually use Read/Show, but it does use a similar class
with similar restrictions).

Your queries are just normal functions in the Reader or State
monad. Reader if you only want to read the data, State if you want to
read and update the data. So, you don't have to learn any special
query language or DSL. And you get all your favorite (pure) haskell
functions, static type checking, etc. If you want a relation type
storage you can use happstack-ixset.

You also get write-ahead logging and checkpointing for recovery, data
migration, and more.

Additionaly, there is multimater support (though not quite suitable
for real deployment yet), and plans for sharding support.

It does not currently provide a mechanism for mapping the data to a
relational database. In theory it would be possible to write a layer
that mapped the current state into a SQL database. That would allow
other programs to use SQL to read the values. However, it would not be
able to support other apps writing updates to the database.

- jeremy



More information about the Haskell-Cafe mailing list