[erlang-questions] Mysql Query builder lib in Erlang?

Vineet Naik <>
Tue Apr 2 14:19:51 CEST 2013


On Tue, Apr 2, 2013 at 5:29 PM, Dmitry Kolesnikov <>wrote:

> Hi,
>
> I've made Erlang port of whiskers.js template library
> https://github.com/fogfish/swirl
>
> as a side effect is become a client-side SQL query template builder, which
> I've started to use for my project.
>
> Here is a small example:
>
> swirl:c(mysql, "SELECT * FROM Users WHERE id={id}").
> mysql:render([{id, "xxx"}]).
> "SELECT * FROM Users WHERE id=xxx"
>

This is an interesting approach but not exactly what I am looking for.
I am searching for an alternative to writing raw queries in code.

I have one idea ie. to express the query may be using tuples and lists. and
have a
set of functions transform it to sql. Not sure if this will make things
more complicated
though :-) but it's just an idea.

Thanks,
vineet


>
> - Dmitry
>
>
> On Apr 2, 2013, at 2:47 PM, Vineet Naik <> wrote:
>
> Hi,
>
> Is there a mysql query builder library for Erlang? On some searching,
> I came across boss_db[1] which is an ORM. While I am open to ORMs and
> planning to give it a try, I would prefer a simple query builder
>
> [1]: https://github.com/evanmiller/boss_db
>
> Regards,
> Vineet
>  _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130402/e54a0f63/attachment.html>


More information about the erlang-questions mailing list