conman icon indicating copy to clipboard operation
conman copied to clipboard

Split one query definition file into many smaller ones

Open fvclaus opened this issue 7 years ago • 2 comments

Is there some built-in functionality that already does that?

I added the following code to my ns:

(defmacro rebind-connection []
  (cons 'do
    (->> (io/file (io/resource "sql"))
     (file-seq)
     (filter #(.isFile %))
     (map #(str "sql/" (.getName %)))
     (map #((fn [] `(conman/bind-connection *db* ~%)))))))

It works, but feels hackish, because bind-connection requires a string as first argument and passing a symbol does not work.

fvclaus avatar Nov 29 '17 13:11 fvclaus

There isn't anything built in for dynamically looking up filenames at the moment. I'd be open to a PR for something like this.

yogthos avatar Nov 29 '17 14:11 yogthos

bind-connection now accepts multiple filenames so I guess this feature is already supported.

sunng87 avatar Dec 12 '21 08:12 sunng87