prowdsponsor / esqueleto

Bare bones, type-safe EDSL for SQL queries on persistent backends.
http://hackage.haskell.org/package/esqueleto
BSD 3-Clause "New" or "Revised" License
177 stars 51 forks source link

TH quasi-quoter for a even more SQL-like language #3

Open meteficha opened 11 years ago

meteficha commented 11 years ago

I'm not sure if this is a good or bad idea, we'd have to try it out. See http://blog.felipe.lessa.nom.br/?p=68#comment-125.

singpolyma commented 11 years ago

If anything TH is introduced, I'd like to see it in a separate package.

I've been thinking for awhile about what it would take to compile actual SQL (of various dialects) to a normalising EDSL for awhile (with a code-generator ofc), so I like the spirit of this idea, but would not like a TH dependency.

meteficha commented 11 years ago

@singpolyma I agree with you wholeheartedly, it would be some kind esqueleto-th package =).

maxnordlund commented 11 years ago

Maybe something for Yesod, which already does a lot of TH? I would love to write SQL-like and have it type safe and serialized by persistent.

nomeata commented 11 years ago

Why go for SQL-like and not to a full support for (a reasonable subset of) SQL? I could imagine that you can write a quasiquoter that takes plain SQL, but parses it at compile time to verify the types and give you that benefit of an EDSL without having to learn a new language.

rehno-lindeque commented 10 years ago

+1 Yes please, something like a esqueleto-th would be very helpful. With the schema I'm working with, most of the identifiers end up so long that they appear nonsensical...