Update dependency ClickHouse.Driver to 1.3.0#219
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.2.0→1.3.0Release Notes
ClickHouse/clickhouse-cs (ClickHouse.Driver)
v1.3.0Compare Source
New Features:
ClickHouseClient.QueryAsync<T>(...)returnsIAsyncEnumerable<T>; rows are materialized lazily and the underlying reader is disposed when enumeration completes, faults, or stops early.ClickHouseDataReader.MapTo<T>()materializes the current row into a registered POCO without advancing the reader.RegisterPocoType<T>(), it sets up both the insert and read mappings, validating both up front.RegisterBinaryInsertType<T>()is unchanged and remains insert-only for backwards compatibility.requiredproperties are supported.StringComparer.Ordinal); missing result columns leave properties at their default value, extra result columns are ignored.InvalidOperationExceptionwith the POCO type, property, column, and returned CLR type. Static mismatches fail fast at firstMapTo<T>()call (or first iteration ofQueryAsync<T>()) before any rows are materialized.LoggerFactoryis configured,RegisterPocoType<T>()/RegisterBinaryInsertType<T>()emit aDebug-level log (categoryClickHouse.Driver.Client) listing which properties mapped to which columns and which were skipped and why.Array(Array(T))and deeper nestings are now supported end-to-end via parameterized queries, binary inserts, and bulk inserts. Both jagged CLR shapes (T[][],List<List<T>>) and rectangular multidimensional CLR shapes (T[,],T[,,], …) are accepted on the write path. Reads return jaggedT[][]viaGetValue; callers who know their data is rectangular can usereader.GetFieldValue<T[,]>(ordinal)and the driver materialises the column as that CLR shape (throwsInvalidOperationExceptionon ragged data).System.ValueTuplevalues (C# tuple literals like(1, "hello")) are now supported in binary inserts, HTTP parameterized queries, and automatic type inference. Tuples with more than 7 elements are correctly flattened from the compiler-generated rest-nesting structure. Note: if you need exactly 7 scalar elements followed by a nested tuple as the 8th element, wrap the inner tuple in an extra layer (e.g.,Tuple.Create(1,...,7, Tuple.Create(Tuple.Create("a","b")))) so the driver can distinguish it from TRest nesting.IParameterFormatterinterface allowing configuration of how parameter values are serialized for HTTP transport (sibling toIParameterTypeResolver, which governs type resolution). SetParameterFormatteronClickHouseClientSettingsto override the built-in serialization logic for any CLR type (e.g., customDateTimeprecision, decimal culture, string escaping). Includes one implementation,DictionaryParameterFormatter, for simple CLR-type → format-function mappings. Returnnullfrom the formatter to fall through to the built-in formatter. Can also be set per-query viaQueryOptions.ParameterFormatter. The formatter is also invoked for every element inside composite values (Array, Tuple, Map, Nested); see docs for quoting caveats when formatting string-like types inside composites.Accept-Encodingoverride: newQueryOptions.AcceptEncoding(mirrored onClickHouseCommand.AcceptEncoding) replaces the defaultgzip, deflateAccept-Encoding header for a single request. Supports multiple algorithms with quality weights (e.g."zstd, gzip;q=0.5") and forcesenable_http_compression=1on the URL so ClickHouse honours the header. For codecs the BCL cannot decode (zstd, lz4) the underlyingHttpClientmust be configured withAutomaticDecompression = Noneand the body consumed viaExecuteRawResultAsync.ClickHouseRawResult.ContentEncoding: exposes the response body'sContent-Encodingfor callers usingExecuteRawResultAsyncto decode it themselves;identityis normalized tonull.IReadValueConverterinterface allows transformation of values returned by the data reader after deserialization (e.g.,DateTime.SpecifyKindto set UTC kind, string trimming/normalization). SetReadValueConverteronClickHouseClientSettingsto apply transformations globally, or override per-query viaQueryOptions.ReadValueConverter. The converter interceptsGetValue()andGetFieldValue<T>()calls, and is also applied during POCO materialization (MapTo<T>()/QueryAsync<T>()). When no converter is set, there is zero performance overhead. Includes one implementation,DictionaryReadValueConverter, with a fluent.For<T>(value => …)registration for dispatch based on CLR type.ClickHouseDataReader.GetFieldValue<T>(string name)overload that resolves the column by name, complementing the existing ordinal-based overload.ClickHouseClientSettings.ApplicationInfoproperty: anIReadOnlyDictionary<string, string>of free-form tags (e.g.app,ver,env) appended to the HTTPUser-Agentheader as a comment token (e.g.(app:MyApp; ver:2.3.1; env:prod)).Identifierquery-parameter type:{name:Identifier}parameters (and explicitClickHouseDbParameter.ClickHouseType = "Identifier") are now supported, letting you safely bind a database/table/column name instead of a quoted string literal — e.g.CREATE DATABASE {name:Identifier}orSELECT {col:Identifier} FROM t. The value is sent verbatim and the server substitutes it as a bare SQL identifier, applying its own backtick quoting/escaping, so identifiers containing special characters (including backticks) round-trip safely with no client-side escaping. Previously these threwArgumentException: Unknown type: Identifier(surfaced from clickhouse-go#1635).ClickHouseClientSettings.ReadBufferSize(and connection-string keyReadBufferSize) controls the size of the buffer used when reading HTTP query responses. Behavioral change: the default has been lowered from 512 KiB to 8 KiB. The previous 512KiB size exceeded the large object heap limit and could cause substantial performance issues due to GC. Workloads with large responses that prefer fewer buffer refills can set a larger value.Improvements:
"Cannot convert 219 to Array(UInt8)") collapsed the outer type, omitted which parameter failed, and didn't say what the value actually was.GetFieldValue<T[,]>errors are now categorised by cause.InvalidCastExceptioncovers type-structure mismatches: the column is null/DBNull, the value isn't a collection, the source's structural depth differs from the target rank (shallower or deeper), or a leaf is the wrong scalar type ornullinto a non-nullable value-type target. Messages include the column ordinal, target CLR type, and offending indices where applicable.InvalidOperationExceptionis reserved for shape-validation failures — the value's structure matchesTbut rows are ragged or an intermediate row is null. Previously, structural-depth mismatches and anullleaf into e.g.int[,]either threwInvalidOperationExceptionor were silently coerced todefault(int).Bug Fixes:
@-styleDateTime/DateTimeOffsetparameters on non-UTC servers (issue #350). When a parameter's ClickHouse type was inferred (no explicit{name:Type}hint in SQL and noparameter.ClickHouseTypeset), the driver previously emitted a bareDateTimehint and the server parsed the wire wall-clock insession_timezone/server tz — silently shifting instant-bearing values by the server's offset. Inferred types forDateTime { Kind: Utc or Local }andDateTimeOffsetare now sent asDateTime('UTC'), preserving the instant across any server timezone. Explicit hints ({name:DateTime}in SQL orparameter.ClickHouseType) are untouched, users who specify the type continue to own timezone correctness.DateTime/DateTime32values outside ClickHouse's supported range (1970-01-01 .. 2106-02-07 06:28:15 UTC). Out-of-range values, e.g.new DateTime(1900, 1, 1), were being cast through a 32-bit signed int and reinterpreted asUInt32by the server, producing real-but-wrong timestamps (e.g.2036-02-07). The same audit fixed analogous silent out-of-range writes forDate32(server would clamp to[1900-01-01, 2299-12-31]) and tightened the existingDateOverflowExceptioninto a descriptiveArgumentOutOfRangeException. All four types now throwArgumentOutOfRangeExceptionatWritetime naming the column type and supported range.DateTimeandDateTime64columns declared with ClickHouse's syntheticFixed/UTC±HH:MM:SStimezone names (e.g.DateTime('Fixed/UTC+05:30:00')). These names are not in the IANA TZDB, soGetZoneOrNullreturnednull, causing the driver to interpret the stored instant as UTC and return a value shifted by the column's offset. The driver now recognises theFixed/UTCpattern and constructs a correct fixed-offsetDateTimeZonefrom it (issue #370).Date,DateTime, andDateTime64values inside composite types such asArray,Tuple,Map, andVariant. These values are now quoted correctly when sent over HTTP.System.Tuplewith more than 7 elements. The TRest nesting was not being flattened, causing the 8th+ elements to be inferred as nested tuple types instead of their actual flat types. This could lead to incorrect ClickHouse type inference and serialization errors.=characters. This fixes cases likevariantType()onVariant(String, DateTime('UTC')), which could previously round-trip through the driver as an empty string.ClickHouseServerException.Messagereturning compressed binary bytes when the server returned a non-2xx response with aContent-Encodingheader. The driver now decompresses gzip / deflate / brotli error bodies before attaching them to the exception. Unknown codecs (zstd, lz4) yield a placeholder pointing atsystem.query_log.Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.