Fork me on GitHub
#honeysql
<
2023-05-30
>
Akiz13:05:01

Hi, why does honeysql formats at? with two question marks? (hsql/format [pg-ops/at? [:-> :a :b] "something"] {:inline true}) => ["(a -> b) @?? 'something'"]

p-himik13:05:38

That seems like an escape sequence. A single ? is a parameter, and ?? is a literal ?, perhaps.

p-himik13:05:56

Unless it doesn't work?..

Akiz13:05:13

DBeaver considers it as an input parameter with one and two question marks. If the interpretation of ? as an input parameter is turned off, both versions work the same.

p-himik15:05:39

Yeah, I wouldn't compare a string designed to be prepared with JDBC to something that DBeaver expects. There can be all sorts of potential differences. If that @?? works just fine, then all is well. If it doesn't, then it should be an issue for HoneySQL.

seancorfield16:05:28

Yes, ?? is an escaped ? for JDBC.

👍 2
Akiz05:05:02

@U2FRKM4TW Sure, but it would be nice to have it there )).

seancorfield05:05:43

The goal of HoneySQL is primarily to produce a vector of SQL + params for use with clojure.java.jdbc or next.jdbc. If you use its output for something else, you may well need to make some adjustments.