Fork me on GitHub
#sql
<
2021-10-14
>
kirill.salykin08:10:36

Hi Sean and everyone I’ve rather wide and controversial question/feature-request A lot of folks using next.jdbc and honeysql together (but not all of course) both next.jdbc and honeysql have a rules to convert sql field names into clojure keys and back would be nice to keep those aligned or configured from one source wdyt? thanks

thumbnail08:10:47

once source would imply 1 common dependency. AFAIK the projects are currently fully separated

kirill.salykin09:10:44

I dont have a solution in my mind, just speaking out the probable improvement point

seancorfield15:10:19

HoneySQL is about generating SQL. next.jdbc is about running SQL and producing results. HoneySQL converts keywords/symbols to column names. next.jdbc converts column names to keywords. The former just needs to produce valid SQL. The latter can be configured with any strategy you want (and there are camel-snake-kebab builders provided if you don't like the default strategy). They are otherwise unrelated.

seancorfield15:10:58

By default, what next.jdbc produces is acceptable to HoneySQL as input for insert operations which is about the only point of interop.

kirill.salykin15:10:28

I understand that, not a big deal for me, just seems like one global point of confiuration would make it cleaner next.jdbc.sql also converts keywords/symbpls to column names

seancorfield16:10:52

Yes, but that is intended to be an extremely simple convenience -- it is not meant to be "full-featured". If you need more than next.jdbc.sql provides, use HoneySQL. Per the docstring on that ns:

This is intended to provide a minimal level of parity with clojure.java.jdbc (insert!, insert-multi!, query, find-by-keys, get-by-id, update!, and delete!).

For anything more complex, use a library like HoneySQL  to generate SQL + parameters.
(I should update that to use the new URL!).

kirill.salykin16:10:05

clear, thanks as i said before - not something really important 🙂