-
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
temporal tables - query part #25060
temporal tables - query part #25060
Conversation
src/EFCore.SqlServer/Extensions/SqlServerQueryableExtensions.cs
Outdated
Show resolved
Hide resolved
src/EFCore.SqlServer/Metadata/Conventions/SqlServerTemporalConvention.cs
Outdated
Show resolved
Hide resolved
for now we still project temporal columns - I added the annotation to the model to filter them out, but hit a bunch of issues in the shaper etc, where we are expecting certain number of columns in the reader, which all need to be tested and fixed. So decided to do the easy thing now to get the query design in place and when thats done, handle the part that removes period columns from query |
|
||
}; | ||
|
||
foreach (var historyTableInfo in historyTableInfos) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will get some sort of helper for this to DRY
src/EFCore.SqlServer/Extensions/SqlServerQueryableExtensions.cs
Outdated
Show resolved
Hide resolved
src/EFCore.SqlServer/Extensions/SqlServerQueryableExtensions.cs
Outdated
Show resolved
Hide resolved
src/EFCore.SqlServer/Query/Internal/TemporalQueryRootExpression.cs
Outdated
Show resolved
Hide resolved
6383d70
to
1463926
Compare
src/EFCore.SqlServer/Query/Internal/TemporalQueryRootExpression.cs
Outdated
Show resolved
Hide resolved
new version up @smitpatel |
src/EFCore.SqlServer/Query/Internal/SqlServerQueryRootCreator.cs
Outdated
Show resolved
Hide resolved
1463926
to
ad1e18d
Compare
src/EFCore.SqlServer/Query/Internal/TemporalQueryRootExpression.cs
Outdated
Show resolved
Hide resolved
test/EFCore.Specification.Tests/Query/GearsOfWarQueryTestBase.cs
Outdated
Show resolved
Hide resolved
test/EFCore.SqlServer.FunctionalTests/Query/TemporalGearsOfWarQuerySqlServerTest.cs
Outdated
Show resolved
Hide resolved
test/EFCore.SqlServer.FunctionalTests/Query/TemporalGearsOfWarQuerySqlServerTest.cs
Outdated
Show resolved
Hide resolved
Looks good, few minor comments. API review will check naming of things. |
ad1e18d
to
1c4d4f8
Compare
src/EFCore.SqlServer/Query/Internal/TemporalQueryRootExpression.cs
Outdated
Show resolved
Hide resolved
test/EFCore.SqlServer.FunctionalTests/Query/TemporalGearsOfWarQuerySqlServerFixture.cs
Show resolved
Hide resolved
1c4d4f8
to
504b9ac
Compare
504b9ac
to
2ca8a45
Compare
- query apis for temporal operations - query root creator service that can now construct query root expressions in nav expansion tests for now are simply converted exisiting tests - used the original model & data - map entities to temporal in the model configuration - modify the data (remove or change values), - manually change the history table to make history deterministic (rather than based on current date), - added visitor to inject temporal operation to every query, which "time travels" to before the modifications above were made, so we should still get the same results as non-temporal & not modified data
2ca8a45
to
4b25a88
Compare
src/EFCore.SqlServer/Metadata/Conventions/SqlServerTemporalConvention.cs
Show resolved
Hide resolved
DateTime pointInTime) | ||
where TEntity : class | ||
{ | ||
Check.NotNull(source, nameof(source)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why all temporal extensions are on DbSet<TEntity>
instead of IQueryable<TEntity>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because these apply to a table in the database, which is represented by a DbSet, and not on any arbitrary IQueryable.
tests for now are simply converted exisiting tests