sqlite-diffable
sqlite-diffable copied to clipboard
Restoring dumps which contain AUTOINCREMENT columns
Hi, great tool, this is exactly what I'm looking for.
I do however have an issue when using AUTOINCREMENT columns.
If you create a table like this
CREATE TABLE IF NOT EXISTS DummyTable (
DummyTableId INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL
);
and insert a row into that table
INSERT INTO DummyTable VALUES(NULL);
the exported dump will contain both the .metadata.json and the .json file of the sqlite_sequence table.
When trying to import that, the import into a new file fails with:
Error: object name reserved for internal use: sqlite_sequence
Importing into an existing file will fail when trying to drop that table.
Updating the table seems to work though, so programming a special case for this to just insert/update any values might work