Case insensitive column in Ecto?

One other advantage that I found with using the citext column type is that I didn’t have to String.downcase my input data or wrap it in a postgres call to lower when querying. In other words I could insert a column with the username mmmries and then if a user searched for MmmrieS it would still find my record. It’s nice to have this automatically done so I don’t forget to downcase a piece of input later.

6 Likes