DotRocks 1.2.0
A minor release of DotRocks — a native .NET driver, Entity Framework Core provider, and Roslyn analyzer suite built specifically for StarRocks. It implements its own managed StarRocks client protocol and takes no runtime dependency on any MySQL driver. Every feature below is verified end to end against StarRocks 4.0.7.
Added
- Server-side prepared statements via
DotRocksParameterMode.ServerPrepared— the binaryCOM_STMT_PREPARE/COM_STMT_EXECUTE/COM_STMT_CLOSEprotocol with binary parameter encoding and result-row decoding, cached and reused per physical connection. Use positional?placeholders. StarRocks 4.0.7 allows onlySELECTin the prepared protocol, so use the text protocol (Auto) for parameterized DML. DbConnection.GetSchema()metadata collections over StarRocksINFORMATION_SCHEMA:MetaDataCollections,Databases,Tables,Views, andColumns, with restriction filtering.- EF Core query translation for explicit relational joins (
Join,GroupJoin/SelectMany+DefaultIfEmpty, cross joins) andGroupBywithHAVINGpredicates and aggregates, plusDateTime/DateOnlymember andAdd…translators andMathmethod translators mapped to StarRocks functions. - Advanced StarRocks table-model fluent APIs for migrations:
DistributedRandomly(buckets)(DISTRIBUTED BY RANDOM),HasSortKey(columns)(ORDER BY), andHasStarRocksProperty(name, value)(additionalPROPERTIES, validated against quote injection). DotRocksJson, an immutable lossless wrapper for StarRocksJSONvalues (and the text-typedARRAY/MAP/STRUCTprojections), read viareader.GetFieldValue<DotRocksJson>(ordinal).StarRocksServerVersionwithDotRocksDbContextOptionsBuilder.ServerVersion(...), an opt-inDetectAsync(connectionString), and ordering (IComparable<StarRocksServerVersion>plus comparison operators) for version gating such asversion >= new StarRocksServerVersion(3, 5).- Stream Load partition targeting and on-the-fly gzip compression (CSV payloads), plus Stream Load, connection-open, and transaction duration metrics on the
DotRocks.Datameter. - Four driver-usage analyzers —
DTR0009(interpolated/concatenatedCommandText),DTR0010(async call missing an availableCancellationToken),DTR0011(blocking on an async call), andDTR0012(hard-coded connection-string password). - Public API surface tracking via
Microsoft.CodeAnalysis.PublicApiAnalyzerswith package validation, plus protocol and parameter-tokenizer fuzz harnesses, and compilable samples for ADO.NET, dependency injection, Dapper, and Stream Load.
Changed
DotRocksDbContextOptionsBuilderis now a relational options builder bound to theDbContextOptionsBuilder; its previously non-functional public parameterless constructor was removed. Configure the provider only through theUseStarRocks(...)options action.- Reduced per-row and per-call allocations on hot paths with no change to observable behavior: result-value decoding now parses directly from UTF-8 spans, the wire-protocol integer reader/writer uses
BinaryPrimitives, SQL literal escaping fast-paths throughSearchValues, and the EF Core function-lookup tables areFrozenDictionary.
Fixed
Math.Round(value, MidpointRounding)is no longer translated to SQL with the rounding mode mistaken for a digit count; it now falls back to client evaluation like other untranslatable calls.
Security
- The ADO.NET
DbConnection.ConnectionStringgetter no longer returns the password (thePersistSecurityInfo=falseconvention), so logging or echoing it cannot leak the secret. - Binary prepared-statement temporal decoders raise a controlled
MalformedPacketExceptionon out-of-rangeDATETIME/TIMEcomponents instead of an uncontrolled exception.
Compatibility
- .NET 10 / C# 14. Source-compatible with 1.1.x except that the unusable
DotRocksDbContextOptionsBuilder()parameterless constructor was removed — configure the provider throughUseStarRocks(...). New public API (server-side prepared statements,GetSchema, the table-model fluent APIs,DotRocksJson,StarRocksServerVersionordering, and the join/aggregate translators) is additive.
Full Changelog: v1.1.0...v1.2.0