honeysql

liebs 2023-04-26T15:28:23.417889Z

bit of a niche thing I suppose but H2's JAVA_OBJECT type requires the keyword :java_object in order to work correctly. Is there a way to support kebab casing here?

seancorfield 2023-04-26T18:31:52.835909Z

Can you provide more context/examples & maybe link to some docs?

liebs 2023-04-26T19:10:20.854259Z

That type is documented http://www.h2database.com/html/datatypes.html#java_object_type. I'm getting some data from an API into our (test) database and among other things it includes positional data that looks like this

{"type" "Point", "coordinates" ["a-lat" "a-lon"]}
H2 has a GEOMETRY type for this but it doesn't support the additional type parameter so I'm just serializing it as is. It really is not terribly important and is more of an observation that if I write something like
(hsql/format {:create-table :foo
              :with-columns [[:bar :java-object]]})
it gives me back ["CREATE TABLE foo (bar JAVA OBJECT)"] which doesn't pass muster with H2.

seancorfield 2023-04-26T19:13:23.527499Z

Ah, gotcha... Not much you can do to get around that at the moment.

liebs 2023-04-26T19:14:37.221069Z

No worries, thanks for HoneySQL, it's awesome!!