-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Document limitation on not null
columns?
#222
Comments
Sorry about that. I'll be sure to announce any future breaking API changes.
You're right. Will make some adjustments. |
Looks like I can enable two-phase commit on Hopefully this means we can get rid of this limitation in the near future. |
That would be even better 😃 |
I'm going to start by creating a separate virtual table for those that need to sync whole rows -- #294 This separate table will always return whole rows if any item in the row changed and always insert whole rows. |
Hi, can we please document this limitation on https://vlcn.io/cr-sqlite/constraints?
cr-sqlite/core/src/tableinfo.c
Lines 476 to 484 in e82ac95
I was unlucky to be testing this out in between when the "not null" constraint was relaxed in 5aebb64 and when it was re-imposed in 11208d0, and it was quite confusing when my change inserts were failing with this opaque error.
I did eventually track it down to the
not null
columns, and it makes sense why the limitation exists: SQLite requires the database"state" to be consistent after each operation is applied, not only when the transaction commits, and since each "change" might not specify a value for all the
not null
columns, you can't guarantee that invariant holds. But I think the explanation slightly misleads, because you can't even usenot null
columns in a newly created, empty table, which would otherwise be ok since there can't possibly be any data that needs to be migrated.The text was updated successfully, but these errors were encountered: