artemeff / eql

Erlang with SQL or not
MIT License
116 stars 18 forks source link

support named parameters for replacement #6

Closed tsloughter closed 7 years ago

tsloughter commented 7 years ago

So this is a huge change... But I tried to keep the api the same. I found neotoma easier to write the parser in and it returns iolists, since that is only done once (and not per-run) I do an iolist_to_binary on the results so it is readable, but this does change the api to be returning binary strings instead of lists.

In the case of replacing named parameters I left them as iolists in that case, since it shouldn't be necessary to flatten them.

I also added support for using -- name: the-name to name the queries, to match yesql, but the format -- :the-name still works as well.

tsloughter commented 7 years ago

D'oh, I somehow missed that you had reviewed!

Do you mean to just warn in the readme that named params aren't sanitized?

artemeff commented 7 years ago

Do you mean to just warn in the readme that named params aren't sanitized?

Yep :)

artemeff commented 7 years ago

Thank you! ❤️