-
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
Model configuration: Make filtered indexes play nice with other providers #7087
Comments
But you can do simply |
@laskoviymishka, in your sample Id is a column, right? In that case, single-quoting it doesn't work in PostgreSQL. The correct way would be to double-quote identifiers, otherwise PostgreSQL automatically lower-cases them. So the PostgreSQL version for your sample would be I'm not sure to what extent quoting/delimiting rules vary that much across providers... It's absolutely certain that we need to have |
Sounds reasonable |
So @AndriySvyryd, @laskoviymishka and anyone else from the EF team, it would be good to have your opinion on whether |
@roji @laskoviymishka We discussed this in triage and decided that we do want to keep the relational API. There are two main reasons for this:
So we want to keep the nice short relational |
👍 to everything @ajcvickers said. I would like to add that I don't discard the possibility of adding support for a more provider agnostic way of specifying index filters in the future, e.g. for this particular case we could leverage To follow the column type analogy, this would be similar to how we added the |
@roji @laskoviymishka Are either of you planning to send a PR to add ForSqlServerHasFilter? |
I'll do this in the next few days. |
As filtered index expressions are very likely to be provider-specific. Closes dotnet#7087
As filtered index expressions are very likely to be provider-specific. Closes #7087
Was this removed? I can't find methods |
@amkhitaryan These were reverted back to a single method. Use |
Thank you. I was trying to specify it in |
#5817, #6866 add support for filtered indexes. While implementing support for this in PostgreSQL I realized that since the filter is an SQL query, in most (all?) cases it's going to be provider-specific due to SQL dialect differences. That is, in PostgreSQL we surround identifiers with double-quotes but in SQL Server we enclose in brackets, and so on.
This may mean that the feature should be moved out of Relational and made accessible only via
ForSqlServerHasFilter()
,ForNpgsqlHasFilter()
, etc. Even if it's decided to keep this in relational,ForSqlServerHasFilter()
is missing.Cc @laskoviymishka who submitted the PR
The text was updated successfully, but these errors were encountered: