honeysql

Akiz 2023-05-30T13:29:01.892439Z

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

p-himik 2023-05-30T13:30:38.391679Z

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

p-himik 2023-05-30T13:30:56.569879Z

Unless it doesn't work?..

Akiz 2023-05-30T13:37:13.868029Z

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-himik 2023-05-30T15:12:39.080969Z

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.

seancorfield 2023-05-30T16:28:28.640949Z

Yes, ?? is an escaped ? for JDBC.

👍 1
Akiz 2023-05-31T05:22:02.008459Z

@p-himik Sure, but it would be nice to have it there )).

seancorfield 2023-05-31T05:42:43.844759Z

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.