Hacker News new | ask | show | jobs
by wwader 821 days ago
Just had to try:

  $ function _select_aux () { clickhouse local -q "SELECT $* FORMAT Pretty" }
  $ alias SELECT='noglob _select_aux'
  $ SELECT COUNT(*) as count FROM file('repos.json', JSON)
  ┏━━━━━━━┓
  ┃ count ┃
  ┡━━━━━━━┩
  │    30 │
  └───────┘
2 comments

This is very nice!! I went down the format clause[1] rabbit hole a couple minutes ago and it looks like they have `FORMAT Markdown` as an option. FORMAT PrettySpaceNoEscapes also looks a bit better than Pretty or the default PrettyCompact imho

1. https://clickhouse.com/docs/en/interfaces/formats

Where's this noglob command coming from? I haven't heard of it before.
Ah sorry that is probably zsh specific, it makes sure to not glob expand * etc