Skip to content

Commit

Permalink
Add async overload for columns+values insert
Browse files Browse the repository at this point in the history
  • Loading branch information
Leon99 committed Nov 18, 2020
1 parent 8173d4f commit 0f503f7
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 @@ -168,6 +168,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 0f503f7

Please sign in to comment.