Closed
Description
Needed by db-to-sqlite. It currently works by collecting all of the foreign key relationships it can find and then applying them at the end of the process.
The problem is, the add_foreign_key()
method looks like this:
sqlite-utils/sqlite_utils/db.py
Lines 498 to 516 in 86bd2bb
That means it's doing a full VACUUM
for every single relationship it sets up - and if you have hundreds of foreign key relationships in your database this can take hours.
I think the right solution is to have a .add_foreign_keys(list_of_args)
method which does the bulk operation and then a single VACUUM
. .add_foreign_key(...)
can then call the bulk action with a single list item.
Metadata
Metadata
Assignees
Labels
No labels