Hi there,
I’m trying to set up an Elixir project (Phoenix, Ecto, Absinthe) connecting to CockroachDB.
I use a modified PostgreSQL driver and roughly followed these steps to make it work with UUIDs.
The problem is with the following SQL query, that is generated by ecto:
SELECT u0.“url”, u0.“link_id”, u0.“link_id” FROM “urls” AS u0 WHERE (u0.“link_id” = ANY($1)) ORDER BY u0.“link_id” [[<<161, 175, 147, 55, 25, 194, 69, 73, 149, 91, 215, 147, 152, 181, 29, 161>>, <<71, 153, 19, 83, 131, 79, 72, 21, 137, 151, 199, 190, 18, 60, 80, 99>>]]
Note that this is the Elixir console output from Ecto. <<…>> is the Elixir representation for binaries.
The following error is raised:
unsupported OID 2951 with format code formatBinary
Does this mean that the combination of an Array of UUIDs as placeholder is not supported in CockroachDB?
Unfortunately, I couldn’t reproduce the query in the CockroachDB CLI, as I couldn’t find how to use placeholders there. Are there any docs I couldn’t find?
The only query I could get to work is:
SELECT u0.“url”, u0.“link_id”, u0.“link_id” FROM “urls” AS u0 WHERE (u0.“link_id” = ANY(ARRAY[’{a1af9337-19c2-4549-955b-d79398b51da1}’, ‘{47991353-834f-4815-8997-c7be123c5063}’])) ORDER BY u0.“link_id”;
I’d appreciate any hints on
- whether or not a placeholder array of UUIDs is supported and, if yes, how
- how to use placeholders in the CockroachDB CLI
Cheers, Arno