Skip to content

Conversation

simolus3
Copy link
Contributor

When an upsert or a delete fails for a raw table, we only report the error code from SQLite. This is not particularly helpful, since it leads to error messages like "powersync_control: internal SQLite call returned CONSTRAINT" without any details.

This improves the error message by contextualizing it with:

  1. the db pointer, allowing us to report more details about the constraint (NOT NULL constraint failed: users.name).
  2. information about the affected table / id / row (replacing into users, id = my_user, data = {...}).

This was reported on Discord.

@simolus3 simolus3 merged commit c923154 into main Sep 23, 2025
23 checks passed
@simolus3 simolus3 deleted the raw-table-error-messages branch September 23, 2025 14:15
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

Successfully merging this pull request may close these issues.

2 participants