hugsql

curtis.summers 2020-06-04T00:40:03.009200Z

Yes, you’re at the mercy of the underlying jdbc libraries, both in Clojure and in the Java jdbc driver library. Here’s an older issue with a few links: https://github.com/layerware/hugsql/issues/43 I’m not sure what the current story is for clojure.java.jdbc or next.jdbc for calling stored procedures. Depending on your needs, you may need to use Java interop.

curtis.summers 2020-06-04T00:41:52.010200Z

That is, of course, the nice thing about Clojure…Java interop can get you there when necessary! 😄

seancorfield 2020-06-04T01:04:47.012800Z

You should be able to simply execute the appropriate SQL to call the procedure via either c.j.j. or next.jdbc. Currently, the major limitation is that you can only get a single result set back, without dropping down to Java interop. That's something that I've looked at for both libraries but just haven't come up with a really good solution for that -- it's a strange-shaped puzzle.

seancorfield 2020-06-04T01:07:06.014900Z

I'm toying with CallableStatement support but a) designing an idiomatic solution to something that inherently uses mutable parameters is a bit hard 🙂 and b) I have never used stored procedures in my entire career and I think they're a bad idea in principle because it is inherently hard to version control such things (because you essentially need to version the contents of a database 😐 ).

seancorfield 2020-06-04T01:08:36.016Z

The main issue is designing a good solution to the whole problem of something returning multiple results (JDBC stuff is fairly unpleasant in some of these areas).