-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Cosmos provider ignores configured indexes #34023
Comments
Or implement it ;) |
I could be wrong, but I don't think a naked |
This definitely would require more thinking... You know more than me, but it seems like it could make sense to apply a Cosmos indexing policy that includes paths only to the properties on which HasIndex() has been called, no? One big difference from relational is that in relational, there are no indexes by default, whereas in Cosmos everything seems to be indexed by default, and the policy is more of a way to do finer-grained tweaking to only index specific properties. In any case, probably not for 9.0, so yeah, validating against HasIndex() at this point sounds like the right thing indeed... |
See #32517 for enabling proper support for HasIndex() on Cosmos. |
This has caused an unforeseen problem with by project. See #35264 |
Another use-case for being able to include HasIndex would be in situations/applications where you want to allow the person installing your software to choose which database provider they wish to use. Since EF Core supports SQL and NoSQL databases now, including CosmosDB it would make sense to ensure that developers can use all of the features & functionality of EF Core in their apps without restricting it with exceptions and other errors/warnings based on the specific provider. My end customer should be able to install my software and select SQL Server, Postgres or Cosmos and EF Core should be able to handle it (as long as I don't do any direct usage of the database/SQL myself). |
For example:
This will currently pass model validation, but the index is ignored. We should fail for this in model validation.
The text was updated successfully, but these errors were encountered: