update db retrieval

This commit is contained in:
Luke Pulverenti
2015-10-27 13:26:04 -04:00
parent 6edd92d2a5
commit 455468ef94
4 changed files with 161 additions and 18 deletions

View File

@@ -144,15 +144,18 @@ namespace MediaBrowser.Server.Implementations.Persistence
{
using (var cmd = _connection.CreateCommand())
{
cmd.CommandText = "select data from users";
cmd.CommandText = "select guid,data from users";
using (var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess | CommandBehavior.SingleResult))
{
while (reader.Read())
{
using (var stream = reader.GetMemoryStream(0))
var id = reader.GetGuid(0);
using (var stream = reader.GetMemoryStream(1))
{
var user = _jsonSerializer.DeserializeFromStream<User>(stream);
user.Id = id;
yield return user;
}
}