You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 21, 2020. It is now read-only.
Something data-oriented like {:select [:x :y] :where [{:x := 1}]}, which allows us to target clauses by type when compiling the query. This might be redundant and unnecessary given representation number 2.
Also data-oriented, but as a collection, like [{:t :select :v :x} {:t :select :v :y} {:t :where :k :x :op := :v 1}]. This allows the user to easily compose/modify queries, since a query is a (recursive, with subqueries) collection of clauses.
A convenience layer, e.g. (q (select x y z) (where= x 1)). The q function should compile directly to the collection representation above, flattening values returned from query building functions/macros into a single list. This should recur into subqueries as well.
A compile function should take any of the three representations above and turn it into a string, escaping literals and identifiers as necessary. If the input is a string already, it should just return it.
Execution functions shouldn't know about this layer, but should expose a configuration option for preparing queries, which can be configured by setting it to compile.
The text was updated successfully, but these errors were encountered:
Three layers:
{:select [:x :y] :where [{:x := 1}]}
, which allows us to target clauses by type when compiling the query. This might be redundant and unnecessary given representation number 2.[{:t :select :v :x} {:t :select :v :y} {:t :where :k :x :op := :v 1}]
. This allows the user to easily compose/modify queries, since a query is a (recursive, with subqueries) collection of clauses.(q (select x y z) (where= x 1))
. Theq
function should compile directly to the collection representation above, flattening values returned from query building functions/macros into a single list. This should recur into subqueries as well.A
compile
function should take any of the three representations above and turn it into a string, escaping literals and identifiers as necessary. If the input is a string already, it should just return it.Execution functions shouldn't know about this layer, but should expose a configuration option for preparing queries, which can be configured by setting it to
compile
.The text was updated successfully, but these errors were encountered: