Add meta unwrap for more feature support
This commit is contained in:
parent
ae6229c282
commit
4d3b317520
1 changed files with 8 additions and 1 deletions
|
|
@ -528,6 +528,13 @@
|
||||||
{:valid-dialects (vec (sort (keys dialects)))})))
|
{:valid-dialects (vec (sort (keys dialects)))})))
|
||||||
dialect)
|
dialect)
|
||||||
|
|
||||||
|
(defn- unwrap [x opts]
|
||||||
|
(if-let [m (meta x)]
|
||||||
|
(if-let [f (::wrapper m)]
|
||||||
|
(f x opts)
|
||||||
|
x)
|
||||||
|
x))
|
||||||
|
|
||||||
(defn format
|
(defn format
|
||||||
"Turn the data DSL into a vector containing a SQL string followed by
|
"Turn the data DSL into a vector containing a SQL string followed by
|
||||||
any parameter values that were encountered in the DSL structure."
|
any parameter values that were encountered in the DSL structure."
|
||||||
|
|
@ -544,7 +551,7 @@
|
||||||
*quoted* (if (contains? opts :quoted)
|
*quoted* (if (contains? opts :quoted)
|
||||||
(:quoted opts)
|
(:quoted opts)
|
||||||
dialect?)]
|
dialect?)]
|
||||||
(format-dsl data)))))
|
(mapv #(unwrap % opts) (format-dsl data))))))
|
||||||
|
|
||||||
(defn set-dialect!
|
(defn set-dialect!
|
||||||
"Set the default dialect for formatting.
|
"Set the default dialect for formatting.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue