SQLiteでDBのマージ
マージ先のDBを開いてる状態で実行
sqlite> attach database 'old_db.db' as old1; sqlite> begin; sqlite> insert into main.test_table(col1,col2,col3) select col1,col2,col3 from old1.test_table; sqlite> commit;
'old_db.db'はマージ元のファイル
マージ先のDBを開いてる状態で実行
sqlite> attach database 'old_db.db' as old1; sqlite> begin; sqlite> insert into main.test_table(col1,col2,col3) select col1,col2,col3 from old1.test_table; sqlite> commit;
'old_db.db'はマージ元のファイル