Adding some flexibility to sqlite3 and dbconsole
With sqlite3 you can pass in a few arguments to the sqlite3 command to initialize your session with some, in my opinion, better defaults. The sqlite3 command I typically use looks like this:
sqlite3 -column -header [database]
This simply puts sqlite3 in to column mode and displays the names of the column (headers) above the table. It reads a lot easier to me. A majority of the time I go in to the sqlite3 database I end up issuing the command:
mode column
header on
So what I wanted to do was something like this:
./script/dbconsole --mode column --header
Seemed easy enough … but keep in mind, this is just a personal preference, but the current implementation of the ./script/dbconsole command did not allow me to do this:
./script/dbconsole --mode [column, line, list, html] --header
I modified the dbconsole script a little bit to allow for this functionality. With this patch you can now issue these optional commands. Obviously if you don’t provide any of the options the script will just load you in to your default sqlite3 instance and you can go from there.
It took me about 30 minutes to put this together and I’m sure there are some things that I’m missing, but this should at least get you started.
Please let me know if you make any changes as I would be interested in seeing them.
1908.txt;1;1
1908.txt;1;1