4 ms·
It uses "PRAGMA foreign_keys=0" and "PRAGMA defer_foreign_keys= ON" before running the transformation, then resets those settings afterwards: https://github.com
by simonw 4mo ago
It uses "PRAGMA foreign_keys=0" and "PRAGMA defer_foreign_keys= ON" before running the transformation, then resets those settings afterwards: https://github.com/simonw/sqlite-utils/blob/3f0471701b5f8c7de888a467020e5dd34310ce9a/sqlite_utils/db.py#L2571 https://github.com/simonw/sqlite-utils/blob/3f0471701b5f8c7d...
That's the pattern recommended by SQLite here: https://www.sqlite.org/lang_altertable.html#otheralter https://www.sqlite.org/lang_altertable.html#otheralter
- simonw 4mo agoThanks for the nudge, I just added a new test explicitly covering this: https://github.com/simonw/sqlite-utils/commit/d71420065903ff54247b5062b8c6af6165b7e638 https://github.com/simonw/sqlite-utils/commit/d71420065903ff...