Skip to content

Commit

Permalink
Merge pull request #429 from Leon99/master
Browse files Browse the repository at this point in the history
Add async overload for columns+values insert
  • Loading branch information
ahmad-moussawi authored May 31, 2021
2 parents 5a0ce95 + 0f503f7 commit 50d2756
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions SqlKata.Execution/Query.Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ public static int Insert(this Query query, IEnumerable<string> columns, IEnumera
return CreateQueryFactory(query).Execute(query.AsInsert(columns, valuesCollection), transaction, timeout);
}

public static async Task<int> InsertAsync(this Query query, IEnumerable<string> columns, IEnumerable<IEnumerable<object>> valuesCollection, IDbTransaction transaction = null, int? timeout = null)
{
return await CreateQueryFactory(query).ExecuteAsync(query.AsInsert(columns, valuesCollection), transaction, timeout);
}

public static int Insert(this Query query, IEnumerable<string> columns, Query fromQuery, IDbTransaction transaction = null, int? timeout = null)
{
return CreateQueryFactory(query).Execute(query.AsInsert(columns, fromQuery), transaction, timeout);
Expand Down

0 comments on commit 50d2756

Please sign in to comment.