Skip to content

Conversation

@okramarenko
Copy link
Collaborator

@okramarenko okramarenko commented Jan 22, 2026

  • Add support for CONVERT_TZ via EF.Functions.ConvertTimeZone()
  • Fix sql_mode related bugs in regards to master/admin connections
  • Stop using SingleStoreValueGenerationStrategy.ComputedColumn annotations for RowVersion and fix computed columns

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades the SingleStore Entity Framework Core provider from version 8.0.1 to 8.0.2. The primary changes include adding support for timezone conversions via EF.Functions.ConvertTimeZone(), fixing sql_mode related bugs for master/admin connections, and addressing computed column annotations for RowVersion properties.

Changes:

  • Added CONVERT_TZ support through new EF.Functions.ConvertTimeZone() methods with corresponding translation logic
  • Fixed sql_mode bug that was incorrectly applying settings to master/admin connections
  • Updated computed column strategy to properly handle RowVersion properties and exclude them from SingleStoreValueGenerationStrategy.ComputedColumn annotations
  • Updated project file references to support configurable build configurations via LocalEFCoreRepositoryConfiguration
  • Updated dependencies to EF Core 8.0.2 and System.Text.Json 8.0.2

Reviewed changes

Copilot reviewed 39 out of 40 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Version.props Updated version from 8.0.1 to 8.0.2
Dependencies.targets Updated EF Core and related package versions to 8.0.2
Directory.Build.props Added configuration properties for local EF Core repository builds
src/EFCore.SingleStore/Extensions/SingleStoreDbFunctionsExtensions.cs Added 10 new ConvertTimeZone method overloads for timezone conversion support
src/EFCore.SingleStore/Query/ExpressionTranslators/Internal/SingleStoreDbFunctionsExtensionsMethodTranslator.cs Implemented translation logic for ConvertTimeZone methods to SQL CONVERT_TZ function
src/EFCore.SingleStore/Query/Internal/SingleStoreDateTimeMemberTranslator.cs Added support for translating DateTimeOffset.DateTime, UtcDateTime, and LocalDateTime properties
src/EFCore.SingleStore/Storage/Internal/SingleStoreRelationalConnection.cs Fixed sql_mode bug by checking IsMasterConnection flag and refactored to use direct command execution
src/EFCore.SingleStore/Extensions/SingleStorePropertyExtensions.cs Updated IsCompatibleComputedColumn to exclude concurrency token properties from computed column strategy
src/EFCore.SingleStore/Infrastructure/SingleStoreDbContextOptionsBuilder.cs Added SessionTimeZone configuration method
src/EFCore.SingleStore/Infrastructure/Internal/SingleStoreOptionsExtension.cs Added SessionTimeZone property to options extension
src/EFCore.SingleStore/Query/ExpressionVisitors/Internal/SingleStoreQuerySqlGenerator.cs Removed custom VisitOrdering override and added empty values validation
test/EFCore.SingleStore.Tests/Query/SingleStoreTimeZoneTest.cs Added comprehensive tests for timezone conversion functionality
Multiple .csproj files Updated HintPath references to use LocalEFCoreRepositoryConfiguration variable
Multiple test files Updated test expectations to match EF Core 8.0.2 behavior for primitive collections and query generation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +135 to +147
public virtual SingleStoreDbContextOptionsBuilder SessionTimeZone(string offset)
{
if (string.IsNullOrWhiteSpace(offset))
throw new ArgumentException("Session time zone offset must be a value like '+02:00' or '-08:00'.", nameof(offset));

var extension = OptionsBuilder.Options.FindExtension<SingleStoreOptionsExtension>()
?? new SingleStoreOptionsExtension();

((IDbContextOptionsBuilderInfrastructure)OptionsBuilder)
.AddOrUpdateExtension(extension.WithSessionTimeZone(offset));

return this;
}
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

The public method SessionTimeZone is missing XML documentation comments. Other public methods in this class have XML doc comments (e.g., EnableStringComparisonTranslations, EnablePrimitiveCollectionsSupport). Add XML documentation that describes the purpose, parameters, and return value of this method to maintain consistency with the rest of the codebase.

Copilot uses AI. Check for mistakes.
{
"Data": {
"ConnectionString": "server=SINGLESTORE_HOST;user id=SQL_USER_NAME;password=SQL_USER_PASSWORD;port=3306;database=singlestoretest;sslmode=None",
"ConnectionString": "server=SINGLESTORE_HOST;user id=SQL_USER_NAME;password=SQL_USER_PASSWORD;port=3306;database=singlestoretest;sslmode=None;allow user variables=True;",
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

The connection string has a trailing semicolon at the end. While this is not technically incorrect, it's inconsistent with the pattern used in other test configuration files. For consistency, consider removing the trailing semicolon.

Suggested change
"ConnectionString": "server=SINGLESTORE_HOST;user id=SQL_USER_NAME;password=SQL_USER_PASSWORD;port=3306;database=singlestoretest;sslmode=None;allow user variables=True;",
"ConnectionString": "server=SINGLESTORE_HOST;user id=SQL_USER_NAME;password=SQL_USER_PASSWORD;port=3306;database=singlestoretest;sslmode=None;allow user variables=True",

Copilot uses AI. Check for mistakes.
@okramarenko okramarenko merged commit acd571b into master Jan 23, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants