rubysequelcollate

How to use "COLLATE AS" with Sequel and Ruby


When using Sequel, is it possible to produce a "SQL WHERE" clause that contains "COLLATE AS?":

ColumnName COLLATE Latin1_General_CS_AS

If not, then what can I use to do this?

I searched through the Sequel documentation and Stack Overflow and this has not been mentioned there.


Solution

  • Sequel doesn't have direct support for COLLATE, so you have to use literal SQL for that part:

    where(Sequel.lit('? COLLATE Latin1_General_CS_AS', :ColumnName))