Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split one query definition file into many smaller ones #51

Open
fvclaus opened this issue Nov 29, 2017 · 2 comments
Open

Split one query definition file into many smaller ones #51

fvclaus opened this issue Nov 29, 2017 · 2 comments

Comments

@fvclaus
Copy link

fvclaus commented Nov 29, 2017

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.

@yogthos
Copy link
Member

yogthos commented Nov 29, 2017

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.

@sunng87
Copy link
Contributor

sunng87 commented Dec 12, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants