Skip to content

NotSupportedException: Cannot update List`1: it has no PK #126

Description

@StevenDextrain

Hello guys, I need your help, I'm using SQLite4Unity3d on Unity, and I have this error :
NotSupportedException: Cannot update List`1: it has no PK
The line giving this error is :

var updateQuery = DatabaseManager.database.Query<Device>("UPDATE Device SET lastCalibration = ? WHERE Id = ?", DateTime.Now, currentDevice.Id);
DatabaseManager.database.Update(updateQuery);

currentDevice.Id is a simple int, in this instance, it's 1.
For some reason, the update works (updates my DB correctly), but causes issues with my application so I can't keep it like that.
I've already checked multiple times, the table HAS a primary key (Id), it is correctly initialized in my class, and I don't know where this issue could come from.
I've looked around the internet and didn't find a solution that worked for me, so I'm contacting you as a last resort.
Thanks in advance for your answers, let me know if you need more information, have a great day !

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions