Skip to content

More specific COLLATE enum #2159

@LucaCappelletti94

Description

@LucaCappelletti94

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions