LoginSignup
0
2

More than 3 years have passed since last update.

【SQLite3】SQLite3のインストールとコマンドラインツールの使い方

Last updated at Posted at 2019-10-27

SQLite3を操作する際に必要なコマンドを記録していきます。
私自身SQLite3初心者なので、基本的なところから勉強して少しずつまとめて更新していきます。

なお、使っているOSがUbuntu18.04なので、WindowsOSの方と表示等に若干の差異があるかと思いますが、ご了承ください。

SQLite3のインストール

sudo apt install sqlite3

コマンドラインツール

コマンドラインツールの起動

sqlite3 sample.sqlite3

上記のコマンドを入力することでSQLite3のコマンドラインツールが起動して下記のように表示され、ターミナル上でSQLite3の操作を行うことができます。

実行結果
SQLite version 3.22.0 2018-01-22 18:45:57
Enter ".help" for usage hints.
sqlite> 

コマンドラインツールの見た目確認

SQLiteコマンドの.showを使うとコマンドラインツールでのデータ表示の見た目を確認できます。

.show
実行結果
sqlite> .show
        echo: off
         eqp: off
     explain: auto
     headers: off
        mode: list
   nullvalue: ""
      output: stdout
colseparator: "|"
rowseparator: "\n"
       stats: off
       width: 
    filename: sample.sqlite3
sqlite> 

コマンドラインツールの終了

.exit

このコマンドでSQLite3のコマンドラインツールを終了します。
Ubuntu18.04ではショートカット(ctrl+D)でも終了することができます。


本記事目次ページ

【データベース】SQLite3・JDBCまとめ

参考サイト

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2