honeysql

Discussion of https://github.com/seancorfield/honeysql :slightly_smiling_face:
richiardiandrea 2018-06-21T23:03:31.000193Z

it there a way, by any chance, to kind of "compile" honeysql statements so that I don't need to call format every time I build the query? kind of like crystallizing the static parts?

seancorfield 2018-06-21T23:06:04.000153Z

That wouldn't work in the general case with parameters that could be nil I don't think? (since it would generate different SQL)

richiardiandrea 2018-06-21T23:14:49.000296Z

uhm...right

richiardiandrea 2018-06-21T23:15:19.000178Z

I might be able to memoize somewhere maybe

richiardiandrea 2018-06-21T23:15:32.000073Z

or I am just overengineering 🙂

seancorfield 2018-06-21T23:15:56.000196Z

If you know you'll always get the same SQL regardless of parameter values, you could format it once with dummy values and then just use the first value as a SQL string in actual queries.

seancorfield 2018-06-21T23:16:07.000034Z

But, yeah, I think you've overengineering.

seancorfield 2018-06-21T23:16:18.000131Z

If format is your bottleneck, I'd be shocked 🙂

richiardiandrea 2018-06-21T23:16:28.000120Z

yeah agree