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
Hi,
At this time, the
COLLATEexpr value is treated as aObjectNametype. This is reasonable asCOLLATEcan 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 someCOLLATEvalues which are much more frequent than user-defined ones, such asBINARY,NOCASE,Cetc...I believe that introducing an
CollateTypewith the most common variants plus aCustom(ObjectName)variant could facilitate explicit handling of the commonCOLLATEcases 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
COLLATEand I think such an enum would improve the quality of the code.Best,
Luca