Haskell EDSL to generate SQL?

Hi, I tried to solve some large data processing solely in Haskell so I could avoid lots of eventually very long and complex SQL statements. Unfortunately, as was to be expected, that approach doesn't scale. So I do need an SQL backend. But I hope to be able to use an DSL from which I can automatically generate SQL-Strings instead of writing the SQL statements literally. Has anyone else taken a similar approach? Günther

At Sat, 04 Apr 2009 15:40:56 +0200, Günther Schmidt wrote:
But I hope to be able to use an DSL from which I can automatically generate SQL-Strings instead of writing the SQL statements literally.
Has anyone else taken a similar approach?
HaskellDB has an DSL for generating SQL strings. Though, it is not a straightforward mapping. The haskellDB DSL provides you with relational algebra operators that you use to build your query. - jeremy

Hi Jeremy, thanks for that. I had come across it before but I think I'd prefer a more light-weight approach. Günther Jeremy Shaw schrieb:
At Sat, 04 Apr 2009 15:40:56 +0200, Günther Schmidt wrote:
But I hope to be able to use an DSL from which I can automatically generate SQL-Strings instead of writing the SQL statements literally.
Has anyone else taken a similar approach?
HaskellDB has an DSL for generating SQL strings. Though, it is not a straightforward mapping. The haskellDB DSL provides you with relational algebra operators that you use to build your query.
- jeremy

Hi Jeremy, apologies for my initial response, that was definately premature. I had a second look and am quite impressed now. What is the best resource to look for more detail examples? Günther Jeremy Shaw schrieb:
At Sat, 04 Apr 2009 15:40:56 +0200, Günther Schmidt wrote:
But I hope to be able to use an DSL from which I can automatically generate SQL-Strings instead of writing the SQL statements literally.
Has anyone else taken a similar approach?
HaskellDB has an DSL for generating SQL strings. Though, it is not a straightforward mapping. The haskellDB DSL provides you with relational algebra operators that you use to build your query.
- jeremy

At Sun, 05 Apr 2009 14:32:21 +0200, Günther Schmidt wrote:
What is the best resource to look for more detail examples?
No idea. I have not used it in years. And, last I checked, it is far from perfect. For example, I believe that field names must be unique across all tables. Also, there was a project, coddfish that may be of interest. http://wiki.di.uminho.pt/twiki/bin/view/Research/PURe/CoddFish I think it provides a more direct mapping to SQL. - jeremy

On Sat, Apr 04, 2009 at 03:40:56PM +0200, Gü?nther Schmidt wrote:
Hi,
I tried to solve some large data processing solely in Haskell so I could avoid lots of eventually very long and complex SQL statements.
You won't find something comparable to SQLAlchemy (python ORM mapper) in haskell yet (AFAIK) :-( Also have a look at: http://www.haskell.org/haskellwiki/MetaHDBC (This means writing SQL, but it will be checked) Marc Weber
participants (3)
-
Günther Schmidt
-
Jeremy Shaw
-
Marc Weber