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)))})))
|
||||
dialect)
|
||||
|
||||
(defn- unwrap [x opts]
|
||||
(if-let [m (meta x)]
|
||||
(if-let [f (::wrapper m)]
|
||||
(f x opts)
|
||||
x)
|
||||
x))
|
||||
|
||||
(defn format
|
||||
"Turn the data DSL into a vector containing a SQL string followed by
|
||||
any parameter values that were encountered in the DSL structure."
|
||||
|
|
@ -544,7 +551,7 @@
|
|||
*quoted* (if (contains? opts :quoted)
|
||||
(:quoted opts)
|
||||
dialect?)]
|
||||
(format-dsl data)))))
|
||||
(mapv #(unwrap % opts) (format-dsl data))))))
|
||||
|
||||
(defn set-dialect!
|
||||
"Set the default dialect for formatting.
|
||||
|
|
|
|||
Loading…
Reference in a new issue