row.update() or row.pk
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.2k
- Forks
- 172
- Avg merge
- 9m
- Merged PRs (30d)
- 1
Description
Hi,
fantastic framework for working with Sqlite3 databases!!!
I tried to update spezific rows in a table and used
for row in db[tablename]:
newValue = row["counter"] * row["prize"]
row.update({"Fieldname": newValue})
print(row)
This updates the value in the printet row, but not in the database. So I switched to
db[tablename].update(id, {"Filedname": newValue})
This works fine. But row.update would be nicer, because no need for the id (its that row), no need for the tablename and the db (all defined in the for row ... loop).
Thx
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the row.update() and db[tablename].update(id, {"Filedname": newValue}) entry points described in the issue. Check how row objects retain their table and identifier, then verify the requested behavior against the existing update path. Done means row.update() persists the changed field to the SQLite database.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sqlite
- Domain
- database
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100