On Jan 29, 11:42 pm, Chris Granger <
ibdk...@gmail.com> wrote:
> Ah, my suggestion isn't to have them in main, but to have them at the same
> level your defn's are:
>
> (defdb ...)
> (defentity stations ...)
>
> (defn -main []
> (do-stuff))
Oops, yep, I figured that out after running into some cyclical
dependencies then checking out another github project that's using
Korma (shrink-link).
I hadn't realised that the defentities would get evaluated without
calling them explicitly. That was the dumb bit I guess.
That has allowed me to lein run it but not from my uberjar.
I still haven't figured out defdb though. The reason I'd wrapped it in
-main was to pass username and password from the command line rather
than hardcoding it. i.e. (-main user pass db) or java -jar my.jar user
pass db
How should I handle that?
Cheers,
Simon