Skip to content

Commit

Permalink
Implemented the connection protocol receiving (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
devTryer31 authored Oct 8, 2024
1 parent 4dd1179 commit 2b27fb2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ClickHouse.Client.Tests/ConnectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,17 @@ public void ShouldExcludePasswordFromRedactedConnectionString()
Assert.That(conn.RedactedConnectionString, Is.Not.Contains($"Password={MOCK}"));
}

[Test]
[TestCase("https")]
[TestCase("http")]
public void ShouldSaveProtocolAtConnectionString(string protocol)
{
string protocolPart = $"Protocol={protocol}";
string connString = new ClickHouseConnectionStringBuilder(protocolPart).ToString();
using var conn = new ClickHouseConnection(connString);
Assert.That(conn.ConnectionString, Contains.Substring(protocolPart));
}

[Test]
public async Task ShouldPostDynamicallyGeneratedRawStream()
{
Expand Down
1 change: 1 addition & 0 deletions ClickHouse.Client/ADO/ClickHouseConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ internal ClickHouseConnectionStringBuilder ConnectionStringBuilder
Database = database,
Username = username,
Password = password,
Protocol = serverUri?.Scheme,
Host = serverUri?.Host,
Port = (ushort)serverUri?.Port,
Compression = UseCompression,
Expand Down

0 comments on commit 2b27fb2

Please sign in to comment.