Search code examples
postgresqlservicestackormlite-servicestack

ServiceStack.Ormlite Postgres case insensitive queries


I am looking to cleanly implement a mechanism to override all where clauses that compare strings to do the following

[Column].Value.ToLower() == SqlParam.ToLower()

effectively overcoming the case sensitivity of Postgres.


Solution

  • OrmLite's INamingStrategy allows you to customize how Schemas, Tables and Columns are named and OrmLite's PostgreSQL Provider is already configured to use the PostgreSqlNamingStrategy which converts or .NET's PascalCase names to PostgreSQL-friendly snake_case.