Artur Cegiełka-Posłuszny
03/23/2026, 5:54 AMdatetimeoffset type and DTO mapping in .NET?Rocky
03/23/2026, 5:54 AMdatetimeoffset data type equivalent to the one found in SQL Server. The primary temporal types supported are DATE and DATETIME (which, as of v3.3.5, supports microsecond precision).
Because StarRocks is MySQL-compatible, the roadmap for .NET support generally aligns with maintaining compatibility with standard MySQL drivers (like MySqlConnector) and ORMs (like Entity Framework Core with the Pomelo.EntityFrameworkCore.MySql provider).
Here is the current status regarding your question:
1. datetimeoffset Support
Since StarRocks DATETIME is timezone-agnostic (it stores the date and time as provided without an internal offset), there isn't a direct native mapping for .NET's DateTimeOffset.
Current Workarounds:
* UTC Mapping: The most common practice in .NET is to convert DateTimeOffset to UTC in your application layer or DTO and store it in a StarRocks DATETIME column.
* String Storage: If preserving the specific local offset is critical for your business logic, some users store the value as a VARCHAR or use two columns (one DATETIME for the timestamp and one SMALLINT for the offset in minutes).
2. DTO Mapping in .NET
If you are using Entity Framework Core, you can handle this today using Value Converters. This allows you to automatically map a DateTimeOffset property in your DTO to a DATETIME column in StarRocks:
csharp
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<MyDto>()
.Property(e => e.CreatedAt)
.HasConversion(
v => v.UtcDateTime, // To Store (UTC)
v => new DateTimeOffset(v, TimeSpan.Zero) // To Read
);
}
3. Roadmap
There is no specific mention in the official StarRocks documentation of a dedicated .NET-native driver or a datetimeoffset type being introduced in the immediate roadmap. The project's focus for .NET remains on ensuring seamless integration through the MySQL wire protocol.
If your use case requires specific native handling, I recommend checking the StarRocks GitHub to see if there are community-led discussions or to open a feature request!
Let me know if you need help with anything else!
References
• integrations/smt/starrocks_sqlalchemy.md
• data_source/feature-support-data-lake-analytics.md