honeysql

Discussion of https://github.com/seancorfield/honeysql :slightly_smiling_face:
bja 2017-11-20T16:54:45.000337Z

I have an exec-runner and a query-runner in my company's curiosity.components.jdbc that take our jdbc pool component and a honeysql map and then formats it and queries/executes it. We add in a few other things that didn't exist at the time like statement debugging and explain/explain analysis as options via dynamic binds

bja 2017-11-20T16:55:14.000480Z

most of our code looks like (->> (build-some-map) (query-runner db))

bja 2017-11-20T16:55:40.000445Z

handy because we can test the logic for complicated queries or pull them out and explain them in the repl

bja 2017-11-20T16:56:08.000310Z

we have (with-query-logged ...) and (with-query-explained ...)

seancorfield 2017-11-20T17:05:46.000007Z

Sounds like a good approach @bja!

bja 2017-11-20T17:07:15.000418Z

composing honeysql maps over time has been the only way to stay sane while generating reasonable performant reporting / dashboarding queries

bja 2017-11-20T17:07:57.000340Z

we use a bunch of non-standard SQL features of postgresql and honeysql makes it trivial to support the extra stuff and then live in the usual clojure ecosystem of manipulating maps

bja 2017-11-20T17:08:23.000413Z

it's a big deal when you need to do complicated subqueries or CTEs

bja 2017-11-20T17:10:26.000365Z

being able to take a known-working query map, merge a little extra in and then use that as the basis for a CTE would take a ton of time if I was writing SQL (or using most ORMs)