Skip to content

Commit

Permalink
New specific interfaces for Connection/Command
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkWanderer committed Jul 27, 2020
1 parent 06c099e commit 02405e2
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ public SelectSingleColumnWithCompression(string connectionString) : base(connect
{
Compression = true;
}

}
}
2 changes: 1 addition & 1 deletion ClickHouse.Client/ADO/ClickHouseCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace ClickHouse.Client.ADO
{
public class ClickHouseCommand : DbCommand, IDisposable
public class ClickHouseCommand : DbCommand, IClickHouseCommand, IDisposable
{
private readonly CancellationTokenSource cts = new CancellationTokenSource();
private readonly ClickHouseParameterCollection clickHouseParameterCollection = new ClickHouseParameterCollection();
Expand Down
2 changes: 1 addition & 1 deletion ClickHouse.Client/ADO/ClickHouseConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace ClickHouse.Client.ADO
{
public class ClickHouseConnection : DbConnection, ICloneable
public class ClickHouseConnection : DbConnection, IClickHouseConnection, ICloneable
{
private readonly HttpClient httpClient;

Expand Down
2 changes: 1 addition & 1 deletion ClickHouse.Client/ADO/Readers/ClickHouseRawResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class ClickHouseRawResult : IDisposable
{
private readonly HttpResponseMessage response;

public ClickHouseRawResult(HttpResponseMessage response)
internal ClickHouseRawResult(HttpResponseMessage response)
{
this.response = response;
}
Expand Down
15 changes: 15 additions & 0 deletions ClickHouse.Client/IClickHouseCommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Data;
using System.Threading;
using System.Threading.Tasks;
using ClickHouse.Client.ADO;
using ClickHouse.Client.ADO.Parameters;

namespace ClickHouse.Client
{
public interface IClickHouseCommand : IDbCommand
{
new ClickHouseDbParameter CreateParameter();

Task<ClickHouseRawResult> ExecuteRawResultAsync(CancellationToken cancellationToken);
}
}
10 changes: 10 additions & 0 deletions ClickHouse.Client/IClickHouseConnection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Data;
using ClickHouse.Client.ADO;

namespace ClickHouse.Client
{
public interface IClickHouseConnection : IDbConnection
{
new ClickHouseCommand CreateCommand();
}
}

0 comments on commit 02405e2

Please sign in to comment.