やってみる

アウトプットすべく己を導くためのブログ。その試行錯誤すらたれ流す。

SQLite3ドットコマンド(.dbinfo)

 DBの情報を表示する。

成果物

.help

.dbinfo ?DB?             Show status information about the database

.dbinfo

空DB

sqlite3 :memory: ".dbinfo"
unable to read database header
sqlite3 A.db ".exit"
sqlite3 A.db ".dbinfo"
unable to read database header

テーブル作成後

インメモリ

sqlite3 :memory: \
"create table T(C text);" \
"insert into T values('A');" \
".dbinfo"
database page size:  4096
write format:        1
read format:         1
reserved bytes:      0
file change counter: 0
database page count: 2
freelist page count: 0
schema cookie:       1
schema format:       4
default cache size:  0
autovacuum top root: 0
incremental vacuum:  0
text encoding:       1 (utf8)
user version:        0
application id:      0
software version:    0
number of tables:    1
number of indexes:   0
number of triggers:  0
number of views:     0
schema size:         22
data version         3

ファイル

sqlite3 :memory: \
"create table T(C text);" \
"insert into T values('A');" \
".backup B.db"
sqlite3 B.db ".dbinfo"
database page size:  4096
write format:        1
read format:         1
reserved bytes:      0
file change counter: 1
database page count: 2
freelist page count: 0
schema cookie:       1
schema format:       4
default cache size:  0
autovacuum top root: 0
incremental vacuum:  0
text encoding:       1 (utf8)
user version:        0
application id:      0
software version:    3029000
number of tables:    1
number of indexes:   0
number of triggers:  0
number of views:     0
schema size:         22
data version         1

対象環境

$ uname -a
Linux raspberrypi 4.19.42-v7+ #1218 SMP Tue May 14 00:48:17 BST 2019 armv7l GNU/Linux

前回まで