sqlite のシェルの設定を毎回するのが面倒だった
SQLITE のシェル設定 ~/.sqliterc
ここに記載しておくと、起動時に読み込まれる
~/.sqliterc
.prompt ">> " " ..>" .mode column .headers on
Sqlite3をよく使うときは、このオプション入れとくと見やすくて好き。
設定がロードされると楽
takuya@rena:~/Desktop$ sqlite3 test.db -- Loading resources from /Users/takuya/.sqliterc SQLite version 3.8.10.2 2015-05-20 18:17:19 Enter ".help" for usage hints. >> select * from tableA; id name1 name2 ---------- ---------- ---------- 1 A B 1 C D >>
man に記載があった
INIT FILE sqlite3 reads an initialization file to set the configuration of the interactive environment. Throughout initialization, any previously specified set- ting can be overridden. The sequence of initialization is as follows: o The default configuration is established as follows: mode = LIST separator = "|" main prompt = "sqlite> " continue prompt = " ...> " o If the file ~/.sqliterc exists, it is processed first. can be found in the user's home directory, it is read and processed. It should generally only contain meta-commands. o If the -init option is present, the specified file is processed.