KEMBAR78
Add specific opting out of RETURNING/OUTPUT clause · Issue #29916 · dotnet/efcore · GitHub
Skip to content

Add specific opting out of RETURNING/OUTPUT clause #29916

@ajcvickers

Description

@ajcvickers

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.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions