Fork me on GitHub
#honeysql
<
2023-04-26
>
Ben Lieberman15:04:23

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?

seancorfield18:04:52

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

Ben Lieberman19:04:20

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.

seancorfield19:04:23

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

Ben Lieberman19:04:37

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