-
-
Notifications
You must be signed in to change notification settings - Fork 124
Closed
Labels
Description
Original title: Easier way to update a row returned from .rows
Here's a surprisingly hard problem I ran into while trying to implement #239 - given a row returned by db[table].rows how can you update that row?
The problem is that the db[table].update(...) method requires a primary key. But if you have a row from the db[table].rows iterator it might not even contain the primary key - provided the table is a rowid table.
Instead, currently, you need to introspect the table and, if rowid is a primary key, explicitly include that in the select= argument to table.rows_where(...) - otherwise it will not be returned.
A utility mechanism to make this easier would be very welcome.
Reactions are currently unavailable