Skip to content

Key not found in table <table>: [rowid:NULL] when updating an existing record #1229

Answered by groue
voltangle asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @ggoraa,

For some reason, it can't find the record to update. What am I doing wrong? :) Thanks in advance!

The "Key not found" error message comes from PersistenceError, which is thrown by the update method (and related ones such as updateChanges), when it asked to update a row that does not exist in the database.

It says: "well, you asked me to update the chatFilter whose rowid is NULL, and I could not find any, so I prefer telling you that the update has failed with an error, so that you don't make wrong assumptions".

Indeed, no row in the database can have the value NULL in the rowid column.

Now, you may wonder why the update method attempts at identifying a row with a NULL rowid

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@voltangle
Comment options

@voltangle
Comment options

@groue
Comment options

groue Jun 3, 2022
Maintainer

@voltangle
Comment options

@groue
Comment options

groue Jun 3, 2022
Maintainer

Answer selected by voltangle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants