-
-
Notifications
You must be signed in to change notification settings - Fork 122
Description
I'm trying to use SQLite in integration tests for a codebase where the DB is normally SQL Server. In our SQL Server setup, all collations are case-insensitive by default. As in SQL Server, I've gathered that case-insensitivity in SQLite can be enforced using a column-level collation. The challenge I have is that SQLite doesn't appear to have a notion of a default collation.
I could decorate all my string properties with the CollationAttribute from this project, but I would prefer not to introduce a dependency on SQLite.CodeFirst in the project that contains the entity classes, because SQLite will only be used for integration tests. It would also be far easier to do this if it was possible to set a default collation, rather than decorating every string property with CollationAttribute.
Probably the most elegant thing would if it was possible to do it with some sort of CaseInsensitiveStringsConvention, which would assign the specified collation for all fields of type string. I think this is possible in the most recent version of EF Core, but not in EF6.
I made a proof of concept of my idea in #162. If there already exists a good way to do this currently, I'm happy to adopt that instead.