Fork me on GitHub
#sql
<
2017-06-16
>
pandeiro19:06:09

Speaking of HugSQL, how do people usually get their source SQL files into an uberjar for deployment?

dotemacs19:06:22

@pandeiro theres nothing really special about deployment of HugSQL sql files. Just put them under resources or src, pass the path of the file to hugsql/def-db-fns and you’re ready to go

pandeiro19:06:59

@dotemacs Yeah my problem is that I have them in src, and with my current uberjar task, those files don't make it into the uberjar

pandeiro19:06:14

So I guess moving it to resources is the easiest solution to that

dotemacs19:06:07

well, the documentation states that as long as it’s in the classpath it should work

pandeiro19:06:45

@dotemacs Do clojure source files (*.clj) end up in the uberjar file with lein? (I'm using boot, and mine don't)

pandeiro19:06:14

I thought it would depend on whether I was AOT'ing :all or just the main namespace, but that doesn't seem to make a difference

pandeiro19:06:44

But in dev, yeah, it works great with the query files in src, because the files exist and are on the classpath

dotemacs19:06:11

if you have :omit-source true declaration for a particular profile, say for the :uberjar, then the sources would be omitted

dotemacs19:06:38

I do have the above declaration, but I’m also storing the files under resources and not src

pandeiro19:06:50

Yeah with boot I think omitting source is the default behavior... I've seen people include src in :resource-paths to get around this in fact

pandeiro19:06:03

I'll just move mine to resources/sql/queries.sql, as luminus does, for now

dotemacs19:06:13

And, does that solve the issue?

pandeiro19:06:51

I had a slight preference for placing it in src, and actually Boot would allow me to do some fancy pre-compiling + writing the resulting functions to a dynamically generated namespace -- but for now I'll stick with the simplest solution