Add field option for case-insensitivity (#200)#202
Open
abeverley wants to merge 3 commits into
Open
Conversation
Contributor
Author
|
This is related to issue #200. |
Contributor
|
Hey, this is great - could you just make it warn if it gets inconsistent data; meaning in the case that the postgres gets weird data where the case insensitive flag is on for a non-text col, it should proceed to make it citext but at least warn |
Contributor
Author
|
Thanks for the prompt review. I've added the warning now (only for Pg; SQLite seems to accept the option for any type of field). This means that the test is (rightly) emitting a warning - would you like me to try and silence that somehow? |
Contributor
|
best option is to assert that the test warns :) |
Contributor
Author
Makes sense! Well, I learnt a new module today, I assume |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a field option for case-insensitivity. Whilst this behavior would normally be controlled with collation options, some databases have case-specific options or extensions and it is useful to be able to support these. In my case, I am using
SQL::Translatorto deploy to a SQLite database and theCOLLATE NOCASEoptions need to be provided as part of the field creation.Comments/thoughts welcome if there is a better way to achieve this.