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
Allow .insert(..., foreign_keys=()) to auto-detect table and primary key #25
Comments
Maybe Rules:
If none of these rules match, raise an error. So the above example could be further simplified to: db["usages"].insert_all(
usages_to_insert,
foreign_keys=["line_id", "definition_id"]
) |
If I'm going to do this then I should make the sqlite-utils/sqlite_utils/cli.py Lines 201 to 215 in 2fed87d
|
Still need to add this mechanism to sqlite-utils/sqlite_utils/db.py Lines 115 to 119 in d645032
|
I'm going to reuse the sqlite-utils/sqlite_utils/db.py Lines 17 to 19 in d645032
|
The
foreign_keys=
argument currently takes a list of triples:As of #16 we have a mechanism for detecting the primary key column (the third item in this triple) - we should use that here too, so foreign keys can be optionally defined as a list of pairs.
The text was updated successfully, but these errors were encountered: