-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/3.7.0' into develop
- Loading branch information
Showing
22 changed files
with
703 additions
and
87 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
46 changes: 46 additions & 0 deletions
46
src/Connector.SqlServer/Connector/ConnectionAndTransaction.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using Microsoft.Data.SqlClient; | ||
using System; | ||
using System.Data; | ||
using System.Threading.Tasks; | ||
|
||
namespace CluedIn.Connector.SqlServer.Connector | ||
{ | ||
public class ConnectionAndTransaction : IDisposable, IAsyncDisposable | ||
{ | ||
public readonly SqlConnection Connection; | ||
public readonly SqlTransaction Transaction; | ||
|
||
public ConnectionAndTransaction(SqlConnection connection, SqlTransaction transaction) | ||
{ | ||
Connection = connection; | ||
this.Transaction = transaction; | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
Transaction.Dispose(); | ||
Connection.Dispose(); | ||
} | ||
|
||
public async ValueTask DisposeAsync() | ||
{ | ||
if (Transaction is IAsyncDisposable t) | ||
{ | ||
await t.DisposeAsync(); | ||
} | ||
else | ||
{ | ||
Transaction.Dispose(); | ||
} | ||
|
||
if (Connection is IAsyncDisposable c) | ||
{ | ||
await c.DisposeAsync(); | ||
} | ||
else | ||
{ | ||
Connection.Dispose(); | ||
} | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
using CluedIn.Connector.Common.Clients; | ||
using Microsoft.Data.SqlClient; | ||
using Microsoft.Data.SqlClient; | ||
using System.Collections.Generic; | ||
using System.Data; | ||
using System.Threading.Tasks; | ||
|
||
namespace CluedIn.Connector.SqlServer.Connector | ||
{ | ||
public interface ISqlClient : ITransactionalClientBaseV2<SqlConnection, SqlTransaction, SqlParameter> | ||
public interface ISqlClient | ||
{ | ||
Task<SqlConnection> BeginConnection(IReadOnlyDictionary<string, object> config); | ||
|
||
Task<DataTable> GetTableColumns(SqlConnection connection, string tableName, string schema); | ||
|
||
Task<DataTable> GetTables(SqlConnection connection, string tableName = null, string schema = null); | ||
|
||
Task<ConnectionAndTransaction> BeginTransaction(IReadOnlyDictionary<string, object> config); | ||
|
||
Task ExecuteCommandInTransactionAsync(SqlTransaction transaction, string commandText, IEnumerable<SqlParameter> param = null); | ||
} | ||
} |
This file contains 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
This file contains 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
17 changes: 8 additions & 9 deletions
17
src/Connector.SqlServer/Connector/SqlServerConnectorCommand.cs
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using CluedIn.Core.Crawling; | ||
using System.Collections.Generic; | ||
|
||
namespace CluedIn.Connector.SqlServer; | ||
|
||
public class CrawlJobDataWrapper : CrawlJobData | ||
{ | ||
public CrawlJobDataWrapper(IDictionary<string, object> configurations) | ||
{ | ||
Configurations = configurations; | ||
} | ||
|
||
public IDictionary<string, object> Configurations { get; } | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
using CluedIn.Connector.Common.Configurations; | ||
using CluedIn.Core.Providers; | ||
using System; | ||
|
||
namespace CluedIn.Connector.SqlServer | ||
{ | ||
public interface ISqlServerConstants : IConfigurationConstants | ||
public interface ISqlServerConstants : IExtendedProviderMetadata | ||
{ | ||
Guid ProviderId { get; } | ||
IProviderMetadata CreateProviderMetadata(); | ||
} | ||
} |
This file contains 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
Oops, something went wrong.