edgedb-js
edgedb-js copied to clipboard
Bug in backslash escaping of TS query generation
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