-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
table.update(...) method #35
Comments
The last touched primary key should go in sqlite-utils/docs/python-api.rst Line 126 in ba6bd47
|
Should this support both dictionaries AND keyword arguments? db["events_venues"].update((3, 2), custom_label="Label") Pros: this is quite nice to look at. I'm going to stick with dictionaries only for the moment. |
Spun off from #23 - this method will allow a user to update a specific row.
Currently the only way to do that it is to call
.upsert({full record})
with the primary key field matching an existing record - but this does not support partial updates.This method only works on an existing table, so there's no need for a
pk="id"
specifier - it can detect the primary key by looking at the table.If the primary key is compound the first argument can be a tuple:
The method can be called without the second dictionary argument. Doing this selects the row specified by the primary key (throwing an error if it does not exist) and remembers it so that chained operations can be carried out - see proposal in #23 (comment)
The text was updated successfully, but these errors were encountered: