SQLite: -tabs option is missing
SQLite has a built-in 'tabs' mode. But it is not exposed as a command line option.
sqlite3.exe version 3.33.0 has options for all the other modes:
-markdown, etc. But not
And this causes various workarounds because providing a TAB character on the command line is not so straightforward.
sqlite3 mydb "select * from table1" | tr \| '\t'
sqlite3 -separator $'\t' mydb "select * from table1"
($ tells shell to expand \t to a TAB character)
sqlite3 mydb <<EOF .mode tabs select * from table1; EOF
Neither of these solutions work on Windows.
It should be very easy to implement the
-tabs option. And I believe it will make life easier for many people.
Not speaking to the merits of your suggestion directly, but wanted to be sure you're aware that the commandline interface program does easily let you pick a separator for input or output.
When I do
-separator \t on Windows I get a literal '\t' string as a separator.
I suppose it is the same on Linux. That is why solution #2 above has extra '$'.
And just in case, I did not mean interactive session. There I could activate
.mode tabs directly.
This is about "one-off" commands with the query on the command line.
(4.1) By TripeHound on 2020-10-31 22:15:42 edited from 4.0 in reply to 3 [link] [source]
sqlite3 V1LS.sql3db -cmd ".mode tab" "select * from members"
echo select * from members | sqlite3 V1LS.sql3db -cmd ".mode tab"
seems to work OK in Windows.
I overlooked that
That would be workaround #4.
I still think there should be
-tabs option too though.
Correction: the mode is called 'tabs' not 'tab'.