-
Notifications
You must be signed in to change notification settings - Fork 685
Description
Hi,
At this time, the COLLATE expr value is treated as a ObjectName type. This is reasonable as COLLATE can be define arbitrarily, and can therefore have any value the user may desire.
That being said, like for IndexType, which may be any user-defined index, there are some COLLATE values which are much more frequent than user-defined ones, such as BINARY, NOCASE, C etc...
I believe that introducing an CollateType with the most common variants plus a Custom(ObjectName) variant could facilitate explicit handling of the common COLLATE cases for software using the AST.
In my own specific use case, I am currently finding myself writing a match over a string version of the COLLATE and I think such an enum would improve the quality of the code.
Best,
Luca