Search code examples
c#clickhouselinq2db

Linq2Db streaming from database (ClickHouse)


Does the Linq2Db have a common approach for streaming results from the database? This can be a raw response from the database or IEnumerable<MyObj> (which are internally obtained from the stream)

I would like to get the following behavior: a database query is executed and its result would be loaded not entirely into memory, but in chunks. At the same time, so that the receipt of each chunk does not look like a separate query to the database that is in no way connected with the previous one


Solution

  • For provider ClickHouse.Client a simple call to AsAsyncEnumerable() will work