Fragment-specific code. For the average user, fragments are similar to snippets in that they allow one to build SQL queries, except without having to pass in the fragment as a param. Under the hood however, fragments work very differently from other params; in particular, they are expanded before all other params are applied and have their own separate, hidden registry.
Fragment-specific code. For the average user, fragments are similar to snippets in that they allow one to build SQL queries, except without having to pass in the fragment as a param. Under the hood however, fragments work very differently from other params; in particular, they are expanded before all other params are applied and have their own separate, hidden registry.
(expand-fragments pdef)
Given a parsed def, update the :sql
value such that all fragments are
expanded. Throws an exception if an unknown fragment is encountered.
Given a parsed def, update the `:sql` value such that all fragments are expanded. Throws an exception if an unknown fragment is encountered.
(expand-fragments* sql-template)
Given a vector of sql strings and param maps, expand out any fragments,
represented as hashmap parameters with a :frag
key. Throws an exception
if an unknown fragment is encountered.
Given a vector of sql strings and param maps, expand out any fragments, represented as hashmap parameters with a `:frag` key. Throws an exception if an unknown fragment is encountered.
(frag-ancestors pdef)
Return the ancestors of a fragment beyond that fragment's immediate ancestors. Throws an exception upon detecting a cycle.
Return the ancestors of a fragment beyond that fragment's immediate ancestors. Throws an exception upon detecting a cycle.
(register-fragment exp-pdef ans)
Given a parsed def exp-pdef
with all ancestor frags already expanded,
store it in the fragment registry.
Given a parsed def `exp-pdef` with all ancestor frags already expanded, store it in the fragment registry.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close