Skip to content
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

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

Open
StevenDextrain opened this issue Oct 2, 2023 · 0 comments
Open

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

StevenDextrain opened this issue Oct 2, 2023 · 0 comments

Comments

@StevenDextrain
Copy link

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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant