Azure / Azure/elastic-db-tools

MultiShardDataReader Multiple Result Sets

Open
#148 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
147
Forks
108
PR merge metrics
No merged PRs in 30d

Description

Could someone explain the reasoning behind not supporting multiple result sets.
e.g.
```
using (var cnn = new MultiShardConnection(shardmap.GetShards(), credentialString))
{
using (var cmd = cnn.CreateCommand())
{
cmd.CommandText = "SELECT [Id], [Value] FROM [ValueTable]; SELECT [Id], [Name] FROM [NameTable];";
using (var reader = cmd.ExecuteReader())
{
while (reader.Read())
{
Console.WriteLine("Id: {0}, Value: {1}", reader.GetInt32(0), reader.GetInt32(1));
}
if (reader.NextResult())
{
while (reader.Read())
{
Console.WriteLine("Id: {0}, Name: {1}", reader.GetInt32(0), reader.GetString(1));
}
}
}
}
}
```

I can see internally that your running a ConcurrentQueue and Dequeuing the LabeledDbDataReaders but I'm not sure why you couldn't keep a List of currentlyRead readers once you complete a result set in a reader add it to the List. Then when NextResult() is called move all the readers back to the queue and being reading again.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.