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

Bug in backslash escaping of TS query generation

Open gregdingle opened this issue 1 year ago • 0 comments

Describe the bug I hit this bug when using regexes in my edgeql query, which require backslash escapes "\". It looks like the query generator is not adding another pair of escapes "\" for the TS code. When I add them, everything works as expected.

Example

debtor_name := re_match('Debtor [Nn]ame:?\\s*(.*)?\\s+United States', .extracted_text)[0],

vs

debtor_name := re_match('Debtor [Nn]ame:?\\\\s*(.*)?\\\\s+United States', .extracted_text)[0],

Reproduction Run npx @edgedb/generate queries --target ts . Call the generated query from a TS app. See error.

Expected behavior Expect query to execute.

Versions (please complete the following information): 4.2+8778fc1

gregdingle avatar Feb 23 '24 20:02 gregdingle