merge_using_dump.sh 303 Bytes
Newer Older
Paulo V C Medeiros's avatar
Paulo V C Medeiros committed
1
2
3
4
5
6
7
#!/bin/bash
rm -f dump.sql output_with_dump.db
for f in "$@"; do
    sqlite3 -vfs unix-none $f ".dump" | sed -e "s/CREATE TABLE/CREATE TABLE IF NOT EXISTS/" | sed -e "s/CREATE INDEX/CREATE INDEX IF NOT EXISTS/" >> dump.sql
done
sqlite3 -vfs unix-none output_with_dump.db ".read dump.sql"
rm -f dump.sql