chinnurtb/sql-where — pull request #1 by bosky101 (2014-12-28 22:32:03+00:00)
Title: Feature/sql select

I'm excited to see this project. I was thinking on lines of http://github.com/facebook/osquery, and a SQL interface to query erlang processes. This fits in quite nicely. But would have loved to have the select part as well.

So I've just added support for `select from ` optionally without changing the current `WHERE ...` api.

eg: select * from ads WHERE bidder_id = 1 AND (exchange_id IN (1, 2) OR doma

{{select,'*'},
{from,ads},
{where,{'and',{comp,'=',bidder_id,1},
{'or',{in,exchange_id,[1,2]},
{comp,'=',domain,<<"ebay.ca">>}}}}}

eg: select pacing, freqcap from ads,users WHERE ads.os = 1 and users.id = 2

{{select,[pacing,freqcap]},
{from,[ads,users]},
{where,{'and',{comp,'=','ads.os',1},
{comp,'=','users.id',2}}}}

Added select_parse_tests in sql_where.erl

The second commit allows the use of `and` and `,` interchangeably.

Thanks again for putting this up.

PS: Also would it be a bother if i removed the compile native directive in sql_where.erl ?