Output format support
See original GitHub issueQuite often all appication is doing is just feeding query result to a “processing pipeline” in some format (“returning json from rest api to some client, maybe some SPA” is not an exception here). As clickhouse already supports great variety of output formats that could be fed to the “pipeline” (json, protobuf, avro, arrow, parquet, csv) it looks reasonable to allow query results to be returned in desired format to cut ADO and formatting libraries all together. There can be an extension method on a reader object named, for example, “export”, accepting stream where data should be copied:
var command = connection.CreateCommand();
command.Text = ".... Format Protobuf";
using var reader = await command.ExecuteReaderAsync();
await reader.Export(output);
Another option is having extension method for command:
var command = connection.CreateCommand();
command.Text = ".... Format Protobuf";
using var exporter = await command.ExecuteExportAsync();
await exporter.Export(output);
It is important to separate query execution from “copying results” to be able to handle errors
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Output Formats
Format Command‑line parameter Description
BMP bmp Windows Bitmap
CGImage cgimage Apple Core Graphics
DOT canon dot gv xdot xdot1.2 xdot1.4 Graphviz Language
Read more >Output formats
Output formats are used to determine which data is exported and how data is displayed in many areas of OLIB.
Read more >Format support by output container - MediaLive
The type of output containers – A given output container supports some captions formats and not others. For example, assume that your input...
Read more >GenRocket Supported Output Formats - Solutions
GenRocket can generate data in any format you need. GenRocket Receivers handle formatting generated test data. Our team is constantly adding new ...
Read more >Supported output formats
Standard owner Support for B‑frames VBR Audio Variable...
AVI Microsoft Only through hacks Yes No
MPEG‑2 PS (Program Stream) MPEG Yes Yes ?
MPEG‑2 TS (Transport...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi,
Added
ExecuteRawResultAsync
function, example:It will return an object which exposes an underlying stream, so any format can be used and parsed. Or, if you want to write it somewhere,
CopyToAsync
to another streamReleased version 2.0.0 with this