Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UUID > Detect uuid content to ask people use dedicated type #267

Open
adriens opened this issue Feb 18, 2021 · 0 comments
Open

UUID > Detect uuid content to ask people use dedicated type #267

adriens opened this issue Feb 18, 2021 · 0 comments
Labels

Comments

@adriens
Copy link
Collaborator

adriens commented Feb 18, 2021

Description

In some databases, we have found uuid stored as text in text based column, which is af not optimal. It would be very useful to get a new lint that :

  • based on a sample of rows of column based text
  • check if the content looks like a UUID, based on regular expression
  • perform a WARN and tell the appropriate database type, or at least flag a UUID stored in a bad column type

Testimonial

This new lint idea has been emiited today by Emmanuel Confrere

Implemntation guidelines

public boolean isUUID(String string) {
    try {
        UUID.fromString(string);
        return true;
    } catch (Exception ex) {
        return false;
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant