xo / usql

Universal command-line interface for SQL databases
MIT License
8.91k stars 351 forks source link

Question regarding /gx and /g mode #471

Closed abhishekgahlot2 closed 1 month ago

abhishekgahlot2 commented 3 months ago

Hi, The repo is great.

I am trying it out. I have couple of questions.

I want to run a big query and pass the output to file as json.

I have tried so far is

ch:clickhouse@10/default=> select * from connect_state; \gx  (format=json) output.txt
ch:clickhouse@10/default=> select * from connect_state; \g  (format=json) output.txt

both seems to be doing the same for me.

Wanted to ask which one will not give output in shell and whichone will just output to shell and also dump the data to output.txt

Thanks