Skip to content

DotRocks 1.2.0

Choose a tag to compare

@kidoz kidoz released this 25 Jun 21:06
· 143 commits to main since this release

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 binary COM_STMT_PREPARE / COM_STMT_EXECUTE / COM_STMT_CLOSE protocol with binary parameter encoding and result-row decoding, cached and reused per physical connection. Use positional ? placeholders. StarRocks 4.0.7 allows only SELECT in the prepared protocol, so use the text protocol (Auto) for parameterized DML.
  • DbConnection.GetSchema() metadata collections over StarRocks INFORMATION_SCHEMA: MetaDataCollections, Databases, Tables, Views, and Columns, with restriction filtering.
  • EF Core query translation for explicit relational joins (Join, GroupJoin / SelectMany + DefaultIfEmpty, cross joins) and GroupBy with HAVING predicates and aggregates, plus DateTime / DateOnly member and Add… translators and Math method translators mapped to StarRocks functions.
  • Advanced StarRocks table-model fluent APIs for migrations: DistributedRandomly(buckets) (DISTRIBUTED BY RANDOM), HasSortKey(columns) (ORDER BY), and HasStarRocksProperty(name, value) (additional PROPERTIES, validated against quote injection).
  • DotRocksJson, an immutable lossless wrapper for StarRocks JSON values (and the text-typed ARRAY / MAP / STRUCT projections), read via reader.GetFieldValue<DotRocksJson>(ordinal).
  • StarRocksServerVersion with DotRocksDbContextOptionsBuilder.ServerVersion(...), an opt-in DetectAsync(connectionString), and ordering (IComparable<StarRocksServerVersion> plus comparison operators) for version gating such as version >= 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.Data meter.
  • Four driver-usage analyzers — DTR0009 (interpolated/concatenated CommandText), DTR0010 (async call missing an available CancellationToken), DTR0011 (blocking on an async call), and DTR0012 (hard-coded connection-string password).
  • Public API surface tracking via Microsoft.CodeAnalysis.PublicApiAnalyzers with package validation, plus protocol and parameter-tokenizer fuzz harnesses, and compilable samples for ADO.NET, dependency injection, Dapper, and Stream Load.

Changed

  • DotRocksDbContextOptionsBuilder is now a relational options builder bound to the DbContextOptionsBuilder; its previously non-functional public parameterless constructor was removed. Configure the provider only through the UseStarRocks(...) 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 through SearchValues, and the EF Core function-lookup tables are FrozenDictionary.

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.ConnectionString getter no longer returns the password (the PersistSecurityInfo=false convention), so logging or echoing it cannot leak the secret.
  • Binary prepared-statement temporal decoders raise a controlled MalformedPacketException on out-of-range DATETIME / TIME components 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 through UseStarRocks(...). New public API (server-side prepared statements, GetSchema, the table-model fluent APIs, DotRocksJson, StarRocksServerVersion ordering, and the join/aggregate translators) is additive.

Full Changelog: v1.1.0...v1.2.0