Fix function_name to support REPLACE#773
Conversation
There was a problem hiding this comment.
function_name ::= id | REPLACE | LEFT | RIGHT | LIKE | GLOB | IF | MATCH | REGEX
The idea was to add in all the potential dialect functions that conflict with keywords. There are not many, as listed above. Assuming it doesn't break SqlDelight. Currently I can see that this test fixture breaks https://github.com/sqldelight/sqldelight/blob/98a75c85377e16f9d4efb83b4e57c803c0f8bded/dialects/sqlite-3-24/src/testFixtures/resources/fixtures_sqlite_3_24/extension_expr/Test.s#L3
Looks like it can be fixed by changing the test to avoid using LIKE, e.g use BETWEEN, so that the function_name rule is not accessed, while preserving the purpose of the test to check that expr is expected.
|
Done, added the rest of the keyword functions you listed, each with a fixture (the token is spelled On the sqlite-3-24 side, swapping the dangling |
There was a problem hiding this comment.
Thanks - seems to work
As mentioned, will need the test fix up https://github.com/sqldelight/sqldelight/blob/master/dialects/sqlite-3-24/src/testFixtures/resources/fixtures_sqlite_3_24/extension_expr/Test.s
fixes lysine-dev/sqldelight#6109
Uppercase
REPLACE(...)isn't parsed as a function name becauseREPLACEis a keyword andfunction_name ::= idonly acceptsid. Lowercasereplace(...)already works.REPLACEas afunction_namealternative