tursodatabase / tursodatabase/libsql
sqlite "ConstraintViolation" reported as a "PROXY_ERROR"
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 17.2k
- Forks
- 531
- Avg merge
- 1h 12m
- Merged PRs (30d)
- 1
Description
As mentioned in the title, following are 2 traces coming from turso's UI, it's very easy to reproduce:
Violating NOT NULL constraint
Error: PROXY_ERROR: error executing a request on the primary: NOT NULL constraint failed: User.id
at window.drizzle (https://turso.tech/_next/static/chunks/7061-c994b6446462fd0a.js:1:28549)
at async https://turso.tech/_next/static/chunks/74f8cf84.b675ca02858c4173.js:400:3481
at async https://turso.tech/_next/static/chunks/74f8cf84.b675ca02858c4173.js:25:22415
at async Promise.all (index 0)
at async saveChanges (https://turso.tech/_next/static/chunks/74f8cf84.b675ca02858c4173.js:25:22362)
at async https://turso.tech/_next/static/chunks/74f8cf84.b675ca02858c4173.js:144:7618
Violating UNIQUE constraint
PROXY_ERROR: error executing a request on the primary: UNIQUE constraint failed: User.email
This is a problem as it hurts error handling in apps.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the NOT NULL and UNIQUE constraint failures in the Turso UI, following the primary-request path shown in the traces and the window.drizzle/saveChanges calls. Trace where SQLite constraint errors become PROXY_ERROR; done means these violations are exposed distinctly enough for application error handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sqlite
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100