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

Implement ExecuteDelete #28492

Merged
1 commit merged into from
Aug 3, 2022
Merged

Implement ExecuteDelete #28492

1 commit merged into from
Aug 3, 2022

Conversation

smitpatel
Copy link
Member

Part of #795

@smitpatel smitpatel force-pushed the smit/bulky branch 2 times, most recently from 7c21d42 to 4554d54 Compare July 26, 2022 00:56
@smitpatel smitpatel marked this pull request as ready for review July 26, 2022 01:02
@smitpatel
Copy link
Member Author

smitpatel commented Jul 26, 2022

This covers basic scenario and ability to convert to subquery form. Allowing additional tables is very provider specific. I will add support for it in SqlServer in separate PR. (This PR does improvement for SqlServer when there is only Take specified). Already done.

Pending negative cases

  • TPT
  • TPC
  • Entity splitting
  • Table splitting
  • Non entity - Done

@roji - This is something which can allow you to test against Npgsql.

@smitpatel smitpatel requested a review from a team July 26, 2022 01:04
@roji
Copy link
Member

roji commented Jul 26, 2022

Thanks @smitpatel, will review and implement the PG side against this to validate 👍

Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great @smitpatel, definitely simpler/smaller than I feared it may be 💘

@smitpatel
Copy link
Member Author

Concurrency detector - I definitely think so, it's like a query in that sense.

Query has concurrency detector because ChangeTracker is not thread-safe. Bulk Update/Delete doesn't interact with it (or any other part of DbContext) so not really needed.

@roji
Copy link
Member

roji commented Jul 26, 2022

I thought we used the concurrency detector also because database connections aren't thread-safe... For example, we also use it in ExecuteSqlRaw, which also doesn't have anything to do with the change tracker.

Not sure there's a downside to having it here by default (it can always be disabled for extra perf). /cc @ajcvickers

@smitpatel smitpatel force-pushed the smit/bulky branch 4 times, most recently from 262780c to 9e85a64 Compare July 27, 2022 00:01
@smitpatel
Copy link
Member Author

@roji - Join tests are in for you to light up using syntax.

@smitpatel smitpatel requested review from roji and a team July 27, 2022 00:02
Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - seems mergeable (but am happy to continue iterating on this if you want to add more stuff). Synced my PG PR npgsql/efcore.pg#2449 (filtered by last commit) to do join via PG USING.

@smitpatel
Copy link
Member Author

Added test to block all invalid scenarios

  • Entity splitting
  • Table splitting
  • TPT
  • TPC non-leaf type
  • Non-entity projection
  • Keyless entity which requires subquery form

Also added test for query filter, set operations, FromSql, positive cases for TPT/TPC. Using TPT/TPC in predicate while deleting other entity types.

Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you go @smitpatel. Also synced npgsql/efcore.pg#2449 to the latest state of this.

@ghost
Copy link

ghost commented Jul 29, 2022

Hello @smitpatel!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@smitpatel smitpatel changed the title Implement BulkDelete Implement ExecuteDelete Jul 29, 2022
@ghost
Copy link

ghost commented Jul 29, 2022

Apologies, while this PR appears ready to be merged, I've been configured to only merge when all checks have explicitly passed. The following integrations have not reported any progress on their checks and are blocking auto-merge:

  1. Azure Pipelines

These integrations are possibly never going to report a check, and unblocking auto-merge likely requires a human being to update my configuration to exempt these integrations from requiring a passing check.

Give feedback on this
From the bot dev team

We've tried to tune the bot such that it posts a comment like this only when auto-merge is blocked for exceptional, non-intuitive reasons. When the bot's auto-merge capability is properly configured, auto-merge should operate as you would intuitively expect and you should not see any spurious comments.

Please reach out to us at [email protected] to provide feedback if you believe you're seeing this comment appear spuriously. Please note that we usually are unable to update your bot configuration on your team's behalf, but we're happy to help you identify your bot admin.

@ghost
Copy link

ghost commented Jul 29, 2022

Apologies, while this PR appears ready to be merged, I've been configured to only merge when all checks have explicitly passed. The following integrations have not reported any progress on their checks and are blocking auto-merge:

  1. Azure Pipelines

These integrations are possibly never going to report a check, and unblocking auto-merge likely requires a human being to update my configuration to exempt these integrations from requiring a passing check.

Give feedback on this
From the bot dev team

We've tried to tune the bot such that it posts a comment like this only when auto-merge is blocked for exceptional, non-intuitive reasons. When the bot's auto-merge capability is properly configured, auto-merge should operate as you would intuitively expect and you should not see any spurious comments.

Please reach out to us at [email protected] to provide feedback if you believe you're seeing this comment appear spuriously. Please note that we usually are unable to update your bot configuration on your team's behalf, but we're happy to help you identify your bot admin.

@ghost
Copy link

ghost commented Jul 30, 2022

Apologies, while this PR appears ready to be merged, I've been configured to only merge when all checks have explicitly passed. The following integrations have not reported any progress on their checks and are blocking auto-merge:

  1. Azure Pipelines

These integrations are possibly never going to report a check, and unblocking auto-merge likely requires a human being to update my configuration to exempt these integrations from requiring a passing check.

Give feedback on this
From the bot dev team

We've tried to tune the bot such that it posts a comment like this only when auto-merge is blocked for exceptional, non-intuitive reasons. When the bot's auto-merge capability is properly configured, auto-merge should operate as you would intuitively expect and you should not see any spurious comments.

Please reach out to us at [email protected] to provide feedback if you believe you're seeing this comment appear spuriously. Please note that we usually are unable to update your bot configuration on your team's behalf, but we're happy to help you identify your bot admin.

@ghost
Copy link

ghost commented Aug 1, 2022

Apologies, while this PR appears ready to be merged, I've been configured to only merge when all checks have explicitly passed. The following integrations have not reported any progress on their checks and are blocking auto-merge:

  1. Azure Pipelines

These integrations are possibly never going to report a check, and unblocking auto-merge likely requires a human being to update my configuration to exempt these integrations from requiring a passing check.

Give feedback on this
From the bot dev team

We've tried to tune the bot such that it posts a comment like this only when auto-merge is blocked for exceptional, non-intuitive reasons. When the bot's auto-merge capability is properly configured, auto-merge should operate as you would intuitively expect and you should not see any spurious comments.

Please reach out to us at [email protected] to provide feedback if you believe you're seeing this comment appear spuriously. Please note that we usually are unable to update your bot configuration on your team's behalf, but we're happy to help you identify your bot admin.

@ghost
Copy link

ghost commented Aug 1, 2022

Apologies, while this PR appears ready to be merged, I've been configured to only merge when all checks have explicitly passed. The following integrations have not reported any progress on their checks and are blocking auto-merge:

  1. Azure Pipelines

These integrations are possibly never going to report a check, and unblocking auto-merge likely requires a human being to update my configuration to exempt these integrations from requiring a passing check.

Give feedback on this
From the bot dev team

We've tried to tune the bot such that it posts a comment like this only when auto-merge is blocked for exceptional, non-intuitive reasons. When the bot's auto-merge capability is properly configured, auto-merge should operate as you would intuitively expect and you should not see any spurious comments.

Please reach out to us at [email protected] to provide feedback if you believe you're seeing this comment appear spuriously. Please note that we usually are unable to update your bot configuration on your team's behalf, but we're happy to help you identify your bot admin.

@ghost
Copy link

ghost commented Aug 2, 2022

Apologies, while this PR appears ready to be merged, I've been configured to only merge when all checks have explicitly passed. The following integrations have not reported any progress on their checks and are blocking auto-merge:

  1. Azure Pipelines

These integrations are possibly never going to report a check, and unblocking auto-merge likely requires a human being to update my configuration to exempt these integrations from requiring a passing check.

Give feedback on this
From the bot dev team

We've tried to tune the bot such that it posts a comment like this only when auto-merge is blocked for exceptional, non-intuitive reasons. When the bot's auto-merge capability is properly configured, auto-merge should operate as you would intuitively expect and you should not see any spurious comments.

Please reach out to us at [email protected] to provide feedback if you believe you're seeing this comment appear spuriously. Please note that we usually are unable to update your bot configuration on your team's behalf, but we're happy to help you identify your bot admin.

@ghost ghost merged commit aaefc98 into main Aug 3, 2022
@ghost ghost deleted the smit/bulky branch August 3, 2022 02:33
roji pushed a commit to roji/efcore that referenced this pull request Aug 3, 2022
roji added a commit to roji/efcore.pg that referenced this pull request Aug 5, 2022
roji added a commit to roji/efcore.pg that referenced this pull request Aug 5, 2022
roji added a commit to npgsql/efcore.pg that referenced this pull request Aug 5, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants