artemeff / eql

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

support namespacing queries in ets by filename #8

Closed tsloughter closed 7 years ago

tsloughter commented 7 years ago

Adds support to store queries with a "namespace" based on the name of the file they were loaded from:

eql:compile(test_tab, from_examples_dir("queries.sql"), [namespace]),
eql:get_query({queries, get_all_users}, test_tab)

What do you think? I realized I would end up with dozens of ets tables with like 5 queries each if I used different ets to separate queries with the same name, which is a waste of resources.

artemeff commented 7 years ago

👍