- Add method
ClickHouseDataReader.ConfigureColumnReader
which sets a value cast callback function for the column. The callback function is invoked whenever the reader reads a non-null value from the column. This feature could be useful in cases when ClcikHouseClient doesn't have a built-in type conversion rule, for expample,double -> decimal
,Guid -> string
oruint -> int
.
- Add method
ClickHouseParameterCollection.AddRange
receiveng any enumerable collection ofClickHouseParameter
.
- Fix null reference exception when the garbage collector calls the finalizer for
ClickHouseConnection
(#70).
- Add support for the type
Bool
(#56).
- Return the correct non-generic enumerator for
ClickHouseParameterCollection
(PR #65).
- Remove arguments with default values from constructors of
ClickHouseConnection
. It makes possible to call the constructorClickHouseConnection(sting)
using reflection (#54).
- New mode of passing parameters to a query -
Interpolate
. In this mode values are interpolated into the query text as constant literals. Parameter mode can be set for a connection (the propertyParametersMode
in the connection string), for a command (the propertyClickHouseCommand.ParametersMode
) or for a single parameter (ClickHouseParameter.ParameterMode
) (#49, PR #42).
- Set
DateTimeKind.Unspecified
when cast a value of ClickHouse typesDate
andDate32
to the .NET typeDateTime
(PR #45).
- Fix getting a time zone from IANA code. This fix is only applicable to the .NET 6 version of ClickHouseClient running on Windows (#40).
- Make possible to open a connection to the server with an unrecognized time zone. The
TimeZoneNotFoundException
may be thrown later when reading the column of typeDateTime
orDateTime64
(#40).
- Default protocol revision is set to 54452. This change was made because the minimal protocol revison with profile events was updated in the ClickHouse v21.12.
- .NET 6.0 support (#33):
- New API for time zones. Remove dependency from the package TimeZoneConverter;
- Change mapping of the ClickHouse type
Date
fromDateTime
toDateOnly
. This affects the behavior of methodsClickHouseDataReader.GetValue
andClickHouseDataReader.GetValues
; - Add the method
ClickHouseDataReader.GetDate
for reading values of typesDate
andDate32
.
- Add methods to the
ClickHouseDataReader
for reading values of well-known types (#38):GetBigInteger
;GetIPAddress
;GetSByte
;GetUInt16
;GetUInt32
;GetUInt64
.
- Add support for the type
Date32
(#36). - Add support for profile events. Profile events are disabled by default. To enable it set the value of the property
ClickHouseCommand.IgnoreProfileEvents
tofalse
. Please note that the methodClickHouseDataReader.NextResult
(orNextResultAsync
) should be called for switching between regular data and profile events.
- Fix reading empty values of the type
LowCardinality(String)
(#37).
- Default protocol revision is set to 54450.
- Add support for Transport Layer Security (TLS) connection (#35).
- Classes from the namespace
Octonica.ClickHouseClient
that are now sealed and therefore can't be inherited:ClickHouseColumnWriter
;ClickHouseCommand
;ClickHouseConnection
;ClickHouseConnectionSettings
;ClickHouseDataReader
;ClickHouseParameter
;ClickHouseParameterCollection
;ClickHouseServerInfo
;ClickHouseTableColumnCollection
;ClickHouseTableProvider
;ClickHouseTableProviderCollection
.
- Classes, enums and interfaces from the namespace
Octonica.ClickHouseClient.Protocol
that are no longer public:BlockFieldCodes
;CompressionAlgorithm
;IClickHouseTableWriter
;NullableObjTableColumn<TObj>
.
- The class
ClickHouseColumnSettings
was moved from the namespaceOctonica.ClickHouseClient.Protocol
to the namespaceOctonica.ClickHouseClient
. - The class
Revisions
from the namespaceOctonica.ClickHouseClient.Protocol
was renamed toClickHouseProtocolRevisions
.
- Add XML documentation comments to the NuGet package.
- Fix reading and writing values of the type
Array(LowCardinality(T))
(#34). - Fix error handling for
ClickHouseColumnWriter
.
- Values of the type
FixedString
can be converted to the typechar[]
. - Values of the type
String
can be converted to typeschar[]
andbyte[]
.
- Basic interfaces of the column reader were modified. Despite these interfaces are public, they are supposedly used only by an internal part of ClickHouseClient.
- Add support for user-defined tables in queries. New property
ClickHouseCommand.TableProviders
provides access to a collection of user-defined tables associated with the command. See the section 'Table-valued parameters' of Parameters for details (#24). - Add property
ClickHouseColumnWriter.MaxBlockSize
. This property allows to set the maximal number of rows which can be sent to the server as a single block of data. If an input table contains more rows thanMaxBlockSize
it will be sent to the server by parts (#26). - Add support for the experimental type
Map(key, value)
(#31). - Add support for long integer types
Int128
,UInt128
,Int256
andUInt256
(#27).
- Improve performance of reading and writing values of primitive types.
- Improve connection state management and error handling.
- Fix conversion from
System.Guid
toUUID
. This bug affectedClickHouseColumnWriter
. It caused writing of corrupted values to a column of typeUUID
(#29).
- Add method
ClickHouseConnection.TryPing
. This method allows to send 'Ping' message and wait for response from the server.
- Add cast from
UInt8
tobool
.ClickHouseDataReader.GetBoolean
no longer throws an exception for values of typeUInt8
.
ClickHouseDataReader.GetField
andClickHouseColumnWriter.GetField
now returntypeof(T)
instead oftypeof(Nullable<T>)
for nullable fields. It is possible to get original type of a column from field's type info:ClickClickHouseDataReader.GetFieldTypeInfo(int ordinal).GetFieldType()
.- Stricter column type check.
ClickHouseColumnWriter
throws an exception when a type of a column is ambiguous (for example, a column's type implements bothIReadOnlyList<int>
andIReadOnlyList<int?>
).
- Add support for named tuples.
- Add a way to explicitly set a type of a column. The type could be defined in
ClickHouseColumnSettings
.ClickHouseDataReader
will try to convert a column's value to this type.ClickHouseColumnWriter
will expect a column to be a collection of items of this type. - Add support for
IReadOnlyList<object>
,IList<object>
,IEnumerable<object>
andIAsyncEnumerable<object>
toClickHouseColumnWriter
(#21).
- Add recognition of escape sequences in enum's item names.
- Parameters in the format
@paramName
are supported in the text of a query (#19).
ClickHouseCommand.ExecuteDbDataReader
supports non-default command behavior (#18).- Added method
GetTypeArgument
to the interfaceIClickHouseTypeInfo
. This method allows to get additional arguments of the type (scale, precision, timezone, size).
- Fixed error handling for
ClickHouseConnection.Open
. The socket was not properly disposed when error occurred during opening a connection.
- ClickHouseParameter can't be added to several parameter collections. Use the method
ClickHouseParameter.Clone
to create a parameter's copy which doesn't belong to the collection.
- Octonica.ClickHouseClient for .NET 5.0 was added to NuGet package.
- Added ClickHouseDbProviderFactory which implements DbProviderFactory.
ReadOnlyMemory<char>
orMemory<char>
can be used instead ofstring
when writing values to ClickHouse.ReadOnlyMemory<T>
orMemory<T>
can be used instead ofT[]
(array ofT
) when writing values to ClickHouse.
- Fixed possible race condition when disposing a connection from different threads (#16).
- Improved implementation of various classes from
System.Data.Common
namespace, such asDbConnection
,DbCommand
andDbParameter
.
- Fixed execution of queries which affect large (greater than 2^31) number of rows (#15).
- Fixed comparison of parameter's names in ClickHouseParameterCollection.
- Added public method
ClickHouseParameter.IsValidParameterName
which allows to check if the string can be used as the name of a parameter.
- The driver was incompatible with ClickHouse v2.10 and higher.
- Fixed writing columns from a source which contains more rows than
rowCount
. - Fixed writing columns from a source which implements
IList<T>
but doesn't implementIReadOnlyList<T>
.
- The default name of the client changed from
Octonica.ClickHouse
toOctonica.ClickHouseClient
.
- Added type
DateTime64
. - Implemented methods
NextResult
andNextResultAsync
inClickHouseDataReader
. These methods can be used to read totals and extremes (#11). - Added
Extremes
property toClickHouseCommand
. It allows to toggleextremes
setting for the query. - Added
TimeZone
property toClickHouseParameter
. It allows to specify the timezone for datetime types. - Array can be used as the value of command parameter. Added properties
IsArray
andArrayRank
toClickHouseParameter
(#14).
- The type
UInt64
was mapped to the typeUInt32
in the command parameter.
- Detection of attempts to connect to ClickHouse server with HTTP protocol (#10).
ReadWriteTimeout
is respected in async network operations ifcancellationToken
is not defined (i.e.CanellationToken.None
).
- Default protocol revision is set to 54441.