Changed the query slightly

This commit is contained in:
tidusjar 2016-08-05 12:21:22 +01:00
parent 94f8cee015
commit c4a96e311c

View file

@ -291,9 +291,14 @@ namespace PlexRequests.Store.Repository
var format = values.AddPrefix("@", ","); var format = values.AddPrefix("@", ",");
var processQuery = $"INSERT INTO {tableName} VALUES ({format})"; 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; return result == enumerable.Length;
} }
} }
catch (SqliteException e) when (e.ErrorCode == SQLiteErrorCode.Corrupt) catch (SqliteException e) when (e.ErrorCode == SQLiteErrorCode.Corrupt)
{ {
@ -302,6 +307,7 @@ namespace PlexRequests.Store.Repository
} }
} }
public void DeleteAll(string tableName) public void DeleteAll(string tableName)
{ {
try try