update queries

This commit is contained in:
Luke Pulverenti
2016-11-20 00:59:36 -05:00
parent b06d1851da
commit 64d15be839
9 changed files with 253 additions and 125 deletions

View File

@@ -89,11 +89,12 @@ namespace Emby.Server.Implementations.Data
{
connection.RunInTransaction(db =>
{
var commandText = "replace into users (guid, data) values (?, ?)";
db.Execute(commandText,
user.Id.ToGuidParamValue(),
serialized);
using (var statement = db.PrepareStatement("replace into users (guid, data) values (@guid, @data)"))
{
statement.BindParameters.TryBind("@guid", user.Id.ToGuidParamValue());
statement.BindParameters.TryBind("@data", serialized);
statement.MoveNext();
}
});
}
}
@@ -151,10 +152,11 @@ namespace Emby.Server.Implementations.Data
{
connection.RunInTransaction(db =>
{
var commandText = "delete from users where guid=?";
db.Execute(commandText,
user.Id.ToGuidParamValue());
using (var statement = db.PrepareStatement("delete from users where guid=@id"))
{
statement.BindParameters.TryBind("@id", user.Id.ToGuidParamValue());
statement.MoveNext();
}
});
}
}