New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add_foreign_key(...., ignore=True) #112
Comments
I would add sqlite-utils/sqlite_utils/db.py Lines 731 to 761 in af3f81b
|
Here's how it works for sqlite-utils/sqlite_utils/db.py Lines 327 to 336 in af3f81b
|
Question: if you use That's tricky. I'm leaning towards "that's still an error". Are we ignoring an already existing foreign key, or ignoring all errors? |
Here's an example of some code that would be cleaner with this mechanism: https://github.com/dogsheep/swarm-to-sqlite/blob/f4a82633da927cde672c9d9af92930bfca2e3ddf/swarm_to_sqlite/utils.py#L120-L143 |
When using this library I often find myself wanting to "add this foreign key, but only if it doesn't exist yet". The
ignore=True
parameter is increasingly being used for this else where in the library (e.g. increate_view()
).The text was updated successfully, but these errors were encountered: