- sqlite-dump から sqlite-dump.el をダウンロードする
- .emacs に以下を記載
;;; ===== sqlite-dump ===== (autoload 'sqlite-dump "sqlite-dump" nil t) (modify-coding-system-alist 'file "\\.sqlite\\'" 'raw-text-unix) (add-to-list 'auto-mode-alist '("\\.sqlite\\'" . sqlite-dump))
動作確認
- テストファイル作成
> sqlite3.exe test.sqlite SQLite version 3.6.18 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> CREATE TABLE test (id INTEGER NOT NULL PRIMARY KEY, name TEXT NOT NULL); sqlite> INSERT INTO test VALUES (NULL, 'Tokyo'); sqlite> INSERT INTO test VALUES (NULL, 'Osaka'); sqlite> INSERT INTO test VALUES (NULL, 'Nagoya'); sqlite> SELECT * FROM test; 1|Tokyo 2|Osaka 3|Nagoya sqlite> .exit
- Emacs で test.sqlite を開く
BEGIN TRANSACTION; CREATE TABLE test (id INTEGER NOT NULL PRIMARY KEY, name TEXT NOT NULL); INSERT INTO "test" VALUES(1,'Tokyo'); INSERT INTO "test" VALUES(2,'Osaka'); INSERT INTO "test" VALUES(3,'Nagoya'); COMMIT;
- 項目を追加
INSERT INTO "test" VALUES(4,'Sapporo');
- コマンドラインで確認
> sqlite3.exe test.sqlite SQLite version 3.6.18 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> SELECT * FROM test; 1|Tokyo 2|Osaka 3|Nagoya 4|Sapporo
0 件のコメント:
コメントを投稿