Closed takezoe closed 4 months ago
I think DigitIdentifiers are intended for representing GROUP BY 1, 2, 3 ...
Ah, I see.
In which case do we need to quote them?
Assuming the following query, "123" is parsed as a digit identifier
SELECT * FROM database."123"
and regenerated SQL from the AST will be invalid:
SELECT * FROM database.123
Now I found the root cause is that a digit identifier is generated in Expression.newIdentifier()
for the table name when generate SQL. I will send another PR.
https://github.com/wvlet/airframe/blob/eb3c43e72252b3af89548f64e3942daa4eea2bb4/airframe-sql/src/main/scala/wvlet/airframe/sql/model/Expression.scala#L459-L472
@takezoe I think DigitIdentifiers are intended for representing
GROUP BY 1, 2, 3 ...
. In which case do we need to quote them?