sqlite-net icon indicating copy to clipboard operation
sqlite-net copied to clipboard

Support for creating index with COLLATE NOCASE?

Open pcolmer opened this issue 11 years ago • 3 comments

Any suggestions on how to cleanly implement support for an index to be created with COLLATE NOCASE? In other words, how to introduce something like [Indexed Nocase]? The reason I want this is so that some of my indexes can be used with LIKE which is, by default, case sensitive. Failing that, I guess I can just execute the commands directly and leave the Indexed directive off the specific columns.

pcolmer avatar Dec 15 '14 09:12 pcolmer

I'm using conn.Execute("PRAGMA case_sensitive_like=1") in my SQLiteConnection subclass.

aMarCruz avatar Dec 17 '14 18:12 aMarCruz

@aMarCruz Thanks for the suggestion. I wasn't too happy about doing this because there will be use cases where the indexes already exist and I wasn't sure about the behaviour of using the PRAGMA after that. In the end, I have removed the [Indexed] sections for the three properties I wanted NOCASE indexes for and executed "CREATE INDEX IF NOT EXISTS" for each of them.

pcolmer avatar Dec 18 '14 13:12 pcolmer

I'd love to have support for that as well. Creating collated indexes makes a huge difference and especially since the collate attribute for columns is already there it would be great to have a parameter for the index attribute as well

rwetzold avatar Jul 08 '24 07:07 rwetzold