edgedb-cli icon indicating copy to clipboard operation
edgedb-cli copied to clipboard

Array input query parameters

Open jackfischer opened this issue 7 months ago • 3 comments

  • Gel Version: 6.7
  • Gel CLI Version: 7.4.0
  • OS Version:

Steps to Reproduce:

  1. Use a query parameter of type array<uuid>
oregon_PROD:main> select ActivitySource filter .id in array_unpack(<array<uuid>>$ids);
Parameter <array<uuid>>$ids: ["be24fbde-7d9b-472d-925d-375a4b1172ae"] -- array -> Expected ']' in "\"be24fbde-7d9b-472d-925d-375a4b1172ae\"]"

The error is Expected ']' in "\"be24fbde-7d9b-472d-925d-375a4b1172ae\"]"

Same output when using [<uuid>"....."] or <array<uuid>>[<uuid>"..."]

Image

jackfischer avatar May 20 '25 14:05 jackfischer

It should work if you don't put quotes around the uuids.

I think we need to document this stuff better, and probably also always support a string cast style

msullivan avatar May 20 '25 15:05 msullivan

Incredible, never would have guessed that in a million years. Makes some sense given that you can put in UUID params without quotes, but what is this syntax? This is some special CLI syntax, right?

jackfischer avatar May 20 '25 18:05 jackfischer

Yeah, the CLI does it's own parsing, but proper EdegQL literals should be supported whenever the input is unambiguous.

elprans avatar May 20 '25 20:05 elprans