Skip to content
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

Add specific opting out of RETURNING/OUTPUT clause #29916

Closed
ajcvickers opened this issue Dec 22, 2022 · 0 comments · Fixed by #29917
Closed

Add specific opting out of RETURNING/OUTPUT clause #29916

ajcvickers opened this issue Dec 22, 2022 · 0 comments · Fixed by #29917
Assignees
Labels
area-sqlite area-sqlserver closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-enhancement
Milestone

Comments

@ajcvickers
Copy link
Member

ajcvickers commented Dec 22, 2022

EF 7.0 changed the default update SQL to use the SQL RETURNING/OUTPUT for fetching back database-generated columns. Some cases where identified where this does not work, and so the following opt-out strategies were done:

  • On SQL Server, the OUTPUT clause is incompatible with triggers and certain computed columns. We added the possibility to model a trigger, and made this opt out of the OUTPUT clause.
  • On SQLite, old versions didn't yet support the RETURNING clause. We added logic to detect the SQLite version being used and automatically not use RETURNING.

However, various other incompatibility scenarios were gradually discovered - virtual tables and certain triggers types on SQLite. It's also not a good solution on SQL Server to tell users to configure a fake trigger if they have a problematic computed column.

As a result, in 8.0 we're adding UseSqlOutputClause for SQL Server and UseSqlReturningClause for SQLite, which are targeted, explicit opt-outs specifically for disabling these clauses. A user convention can be used to apply this to all entity types.

@ajcvickers ajcvickers added this to the 7.0.x milestone Dec 22, 2022
roji added a commit to roji/efcore that referenced this issue Dec 22, 2022
roji added a commit to roji/efcore that referenced this issue Jan 10, 2023
roji added a commit to roji/efcore that referenced this issue Jan 10, 2023
roji added a commit to roji/efcore that referenced this issue Jan 20, 2023
roji added a commit to roji/efcore that referenced this issue Jan 25, 2023
@ghost ghost closed this as completed in #29917 Jan 26, 2023
@roji roji reopened this Jan 26, 2023
@roji roji removed this from the 7.0.x milestone Feb 20, 2023
@ajcvickers ajcvickers added this to the 8.0.0 milestone Feb 23, 2023
@ajcvickers ajcvickers added closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. and removed Servicing-consider labels Feb 23, 2023
@ajcvickers ajcvickers removed this from the 8.0.0 milestone Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-sqlite area-sqlserver closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants