ewaters / altsql-shell

An easily extensible DBI shell, perfect for a drop-in replacement to mysql-client
http://ewaters.github.com/altsql-shell
123 stars 19 forks source link

Narrowest possible display without wrapping #4

Open ewaters opened 12 years ago

ewaters commented 12 years ago

If your table has long column names but short values, most of the rendering is of white space:


┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┓
┃ thumb_large_height ┃ thumb_large_width ┃ thumb_small_height ┃ thumb_small_width ┃
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━┩
│ 0                  │ 0                 │ 75                 │ 100               │
│ 0                  │ 0                 │ 0                  │ 0                 │
│ 0                  │ 0                 │ 0                  │ 0                 │
│ 113                │ 150               │ 75                 │ 100               │
│ 113                │ 150               │ 75                 │ 100               │
│ 150                │ 113               │ 100                │ 75                │
│ 113                │ 150               │ 75                 │ 100               │
│ 113                │ 150               │ 75                 │ 100               │
│ 113                │ 150               │ 75                 │ 100               │
│ 113                │ 150               │ 75                 │ 100               │
└────────────────────┴───────────────────┴────────────────────┴───────────────────┘

Find a way to make this more narrow. Perhaps allow the header to span multiple lines:

thumb_large_height    thumb_small_height
  |    thumb_large_width  | thumb_small_width
  v              v        v            v 
+----------+----------+-------------+--------------+