RepoDB icon indicating copy to clipboard operation
RepoDB copied to clipboard

Enchancment: Add caching functionality to ExecuteQueryMultiple

Open BieleckiLtd opened this issue 5 years ago • 6 comments

Currently ExecuteQueryMultiple does not have overload that will take ICache as a parameter, same as for example ExecuteQuery does. It would be useful to being able to return data from cache for ExecuteQueryMultiple method too.

BieleckiLtd avatar Oct 05 '20 17:10 BieleckiLtd

The result of ExcuteQueryMultple is a custom object QueryMultpleExtractor. Do you mean the Extract method will read from the cache?

mikependon avatar Oct 05 '20 17:10 mikependon

Is Extract making actual trip to the database?

BieleckiLtd avatar Oct 05 '20 17:10 BieleckiLtd

No, it is the ExecuteQueryMultiple, but no extraction is happening until the Extract method is called. Maybe you can play around with it and let me know the possibility on how to do the caching there?

mikependon avatar Oct 05 '20 17:10 mikependon

I am afraid to say it is a limitation? But let us see if this is possible.

mikependon avatar Oct 05 '20 17:10 mikependon

In this case I would say it must happen in ExecuteQueryMultiple. If database was already queried by the time Extract was called then it would make no sense to retrieve data from cache at this point.

BieleckiLtd avatar Oct 05 '20 17:10 BieleckiLtd

This operation is lazy, if we are only caching at the ExecuteQueryMultiple, there is no data to cache there, unless the Extract method is called. I think, it is a bit odd to have the caching in the Extract method and have the cache retrieval at the ExecuteQueryMultiple operation. But I suggest, you play around with it and draw a code so we can implement it.

mikependon avatar Oct 05 '20 18:10 mikependon