mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-11 15:56:05 -07:00
Changed the query slightly
This commit is contained in:
parent
94f8cee015
commit
c4a96e311c
1 changed files with 8 additions and 2 deletions
|
@ -60,7 +60,7 @@ namespace PlexRequests.Store.Repository
|
|||
private IDbConnection Connection => Config.DbConnection();
|
||||
|
||||
|
||||
public IEnumerable<T> Custom(Func<IDbConnection , IEnumerable<T>> func)
|
||||
public IEnumerable<T> Custom(Func<IDbConnection, IEnumerable<T>> func)
|
||||
{
|
||||
using (var cnn = Connection)
|
||||
{
|
||||
|
@ -291,9 +291,14 @@ namespace PlexRequests.Store.Repository
|
|||
|
||||
var format = values.AddPrefix("@", ",");
|
||||
var processQuery = $"INSERT INTO {tableName} VALUES ({format})";
|
||||
var result = db.Execute(processQuery, entities);
|
||||
var result = 0;
|
||||
foreach (var e in enumerable)
|
||||
{
|
||||
result += db.Execute(processQuery, e);
|
||||
}
|
||||
return result == enumerable.Length;
|
||||
}
|
||||
|
||||
}
|
||||
catch (SqliteException e) when (e.ErrorCode == SQLiteErrorCode.Corrupt)
|
||||
{
|
||||
|
@ -302,6 +307,7 @@ namespace PlexRequests.Store.Repository
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public void DeleteAll(string tableName)
|
||||
{
|
||||
try
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue