Skip to content

Instantly share code, notes, and snippets.

@nad2000
Created February 26, 2025 02:14
Show Gist options
  • Save nad2000/f54f6085a203ee5286b6160561409306 to your computer and use it in GitHub Desktop.
Save nad2000/f54f6085a203ee5286b6160561409306 to your computer and use it in GitHub Desktop.
How to delete Sqlite3 records that violatie referencial integrity
sqlite3 db.sqlite3 'pragma foreign_key_check;' | tail -n +3 | sed 's/\(\w*\)\s*\(\w*\).*/delete from \1 where id=\2;/' | sqlite3 db.sqlite3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment