We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When inserting rows via the library, is it possible to specify a foreign key to a compound primary key?
For example, suppose I create a table:
db = Database('events.db') db['events'].insert_all([ {'venue': 'Times Square', 'date': '2022-12-31', 'title': 'Rockin New Year Eve'}, {'venue': 'Wembley Stadium', 'date': '2022-06-05', 'title': 'FA Cup'}, {'venue': 'Times Square', 'date': '2021-12-31', 'title': 'Rockin New Year Eve'}, ], pk=('date', 'venue'))
And I want to add related data in another table:
act = {'name': 'Rick Astley', 'venue': 'Times Square', 'date': '2021-12-31' } db['performers'].insert(act, pk=<???>)
Is it possible to specify a value for pk that will point to the compound primary key in events?
pk
events
SQLite does support it: https://www.sqlite.org/foreignkeys.html#fk_composite
The text was updated successfully, but these errors were encountered:
This isn't supported yet - there's an older issue for that here:
Sorry, something went wrong.
Release 3.29
b491f22
Refs simonw#423, simonw#458, simonw#467, simonw#469, simonw#470, simonw#471, simonw#472, simonw#475 Closes simonw#487
No branches or pull requests
When inserting rows via the library, is it possible to specify a foreign key to a compound primary key?
For example, suppose I create a table:
And I want to add related data in another table:
Is it possible to specify a value for
pk
that will point to the compound primary key inevents
?SQLite does support it:
https://www.sqlite.org/foreignkeys.html#fk_composite
The text was updated successfully, but these errors were encountered: