Is there a way in sqlite3 to set .width of all columns to be equal to the width of the column header?
1
vote
2
answers
6801
views
I am using:
- SQLite version 3.21.0
----------
I look for away to prettify my SQLite
SELECT
shell output (to make it more human readable, in essence). This answer helped me a lot.
Though, now I am wondering if there are ways to:
1. Set a column width to be equal exactly to the width of its header? I went through the corresponding section of the documentation — the closest thing it mentions is .width 0
, which effect is explained as follows:
> If you specify a column a width of 0, then the column width is automatically adjusted to be the maximum of three numbers: 10, the width of the header, and the width of the first row of data.
if it was only *'the maximum of **two** numbers: 10 and the width of the header'* — it would suffice my needs, though *'...and the width of the first row of data.'* spoils it for me.
2. Is there a way to set width of all columns to be the same, without knowing in advance how many columns are there? E.g. instead of doing .width 5 5 5
for 3-column SELECT
, I would like to do something like .width all 5
.
Asked by user142547
Jul 17, 2018, 08:07 AM
Last activity: May 11, 2020, 05:06 AM
Last activity: May 11, 2020, 05:06 AM