tconbeer / harlequin

The SQL IDE for Your Terminal.
https://harlequin.sh
MIT License
3.3k stars 76 forks source link

feat: able to extend adapter specific exporter? #575

Open wey-gu opened 3 weeks ago

wey-gu commented 3 weeks ago

Is it reasonable/feasible to make the adapter support certain types of exported formats?

I am thinking of adding support to allow exporting .html file of a NebulaGraph query result(i.e. this), or dot profile file, etc.

This seems to only apply to a specific adapter?

Harlequin is a Great project, thanks so much for creating it!

tconbeer commented 3 weeks ago

Thanks, this is an interesting idea. Actually the v1 implementation of the exporter required adapter-specific implementations, but most adapter authors weren't implementing export, so I refactored to just use arrow + duckdb, which ship with Harlequin core. I could probably walk things back a bit, and bring back adapter-specific export implementations... I admittedly wasn't thinking about non-tabular data formats, but to be honest there is some work to support the full range of formats and options that we already have access to (e.g., more parquet options).

wey-gu commented 2 weeks ago

Simplifying the adapter integration surface in this change is highly reasonable. Your abstraction and contribution documentation are elegant and tasteful, making the adapter implementation feel comfortable. Thank you!