I'm creating a migration tool from sql to mongo, as part of the sql queries I'm using for json auto which results in a json response form sql server.
using dapper looks like that...
var jsonResults = _SqlDb.Query<string>(usersWithDynamicDataQuery, buffered:false, commandTimeout: _SqlCommandTimeoutSeconds);
var jsonResult = string.Concat(jsonResults);
var userDocuments = JsonSerializer.Deserialize<List<UserData>>(jsonResult);
so sql is returning a List with chunks of the full json response
I need to find some more "Memory Flexible" way other than just a string.concat(..) as I'm hitting the CLR limit for a string memory allocation :\
I can always limit the and page over the queries with ROW_NUMBER().. but I really want to utilize as much memory as I can (I have 128GB on the machine) here and make the migration swift with large chunks of data...