-
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
Improve SQL Server insertion logic and other update pipeline optimizations #27573
Conversation
49d7651
to
466fe62
Compare
test/EFCore.Design.Tests/Migrations/Design/CSharpMigrationsGeneratorTest.cs
Show resolved
Hide resolved
test/EFCore.Relational.Specification.Tests/Update/UpdateSqlGeneratorTestBase.cs
Show resolved
Hide resolved
test/EFCore.Relational.Specification.Tests/Update/StoreValueGenerationFixtureBase.cs
Show resolved
Hide resolved
f81b86d
to
96cc0f2
Compare
test/EFCore.Sqlite.FunctionalTests/Update/StoreValueGenerationSqliteTest.cs
Show resolved
Hide resolved
src/EFCore.Relational/Metadata/Builders/IConventionTriggerBuilder.cs
Outdated
Show resolved
Hide resolved
src/EFCore.SqlServer/Update/Internal/SqlServerUpdateSqlGenerator.cs
Outdated
Show resolved
Hide resolved
Validate that trigger names are unique across the hierarchy and across the schema. |
Triggers generally aren't in any schema (#27372 (comment)), but are considered scoped to their table. However, SQL Server/SQLite do not allow two triggers with the same name in the same database (even when they're on different tables); PostgreSQL does allow this. So I'm adding uniquification in SharedTableConvention (like for indexes, check constraints). Makes sense?
Just want to confirm my understanding on why check constraints have model and database names, but not sequence... Is this because (on some databases) you can have multiple check constraints (or triggers) with the same database name (i.e. on different tables), but they still require unique model names so they can be referred to and modified in model-building? Whereas you can never have more than one sequence with the same database name (since they're database-scoped), so we can collapse the database and model names into one? |
80ba153
to
fa7d959
Compare
Yes, but we should also add validation like
It's because they are declared on entity types and therefore can span over multiple tables, but would require a different name for each (or being excluded for some of them) |
src/EFCore.SqlServer/Update/Internal/SqlServerUpdateSqlGenerator.cs
Outdated
Show resolved
Hide resolved
src/EFCore.Relational/Metadata/Conventions/SharedTableConvention.cs
Outdated
Show resolved
Hide resolved
Also add support in |
21044fb
to
2594371
Compare
@AndriySvyryd I think I've addressed most of the above, though I'm sure there's stuff still remaining (it's late 😬). |
src/EFCore.Relational/Metadata/Conventions/TriggerConvention.cs
Outdated
Show resolved
Hide resolved
test/EFCore.Relational.Tests/Metadata/RelationalBuilderExtensionsTest.cs
Outdated
Show resolved
Hide resolved
fa6a0fa
to
69c5592
Compare
Hello @roji! Because this pull request has the 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 (
|
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:
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 thisFrom the bot dev teamWe'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. |
…tions Also make RETURNING the default INSERT strategy for retrieving db-generated values (for other providers). Fixes dotnet#27372 Fixes dotnet#27503
69c5592
to
8b912e1
Compare
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:
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 thisFrom the bot dev teamWe'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. |
Also make RETURNING the default INSERT strategy for retrieving db-generated values (for other providers).
Fixes #27372
Fixes #27503
Fixes #24835