sql

All things SQL and JDBC...
maxp 2020-03-14T07:09:01.195600Z

postgresql jdbc driver doest not support primitive array of uuids

1
maxp 2020-03-14T07:09:30.195900Z

static {
    ARRAY_CLASS_TO_SUPPORT.put(long[].class, LONG_ARRAY);
    ARRAY_CLASS_TO_SUPPORT.put(int[].class, INT_ARRAY);
    ARRAY_CLASS_TO_SUPPORT.put(short[].class, SHORT_ARRAY);
    ARRAY_CLASS_TO_SUPPORT.put(double[].class, DOUBLE_ARRAY);
    ARRAY_CLASS_TO_SUPPORT.put(float[].class, FLOAT_ARRAY);
    ARRAY_CLASS_TO_SUPPORT.put(boolean[].class, BOOLEAN_ARRAY);
    ARRAY_CLASS_TO_SUPPORT.put(String[].class, STRING_ARRAY);
  }

maxp 2020-03-14T07:09:42.196100Z

but that works

maxp 2020-03-14T07:09:53.196400Z

(let [ua (into-array String ["a1dfa22e-bce4-4ef0-979f-d64315c88ce5"])]
    (with-open [c (get-connection ...)]
      (jdbc/execute! c ["select * from uuid_test where u = ANY(?::uuid[])" ua]))) 

đź‘Ť 1
kwladyka 2020-03-14T19:44:36.197Z

thanks, looks better, than mine solution

kwladyka 2020-03-14T19:45:07.197600Z

just for my curiosity. Do you know why JDBC doesn’t support UUIDs array @maxp?