Skip to content

fix(db-sqlite): sqlite unique validation messages #12740

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

Merged
merged 4 commits into from
Jun 10, 2025
Merged

Conversation

JarrodMFlesch
Copy link
Contributor

@JarrodMFlesch JarrodMFlesch commented Jun 10, 2025

Fixes #12628

When using sqlite, the error from the db is a bit different than Postgres.

This PR allows us to extract the fieldName when using sqlite for the unique constraint error.

Postgres error response

CleanShot 2025-06-09 at 21 33 57@2x

Sqlite error response

CleanShot 2025-06-09 at 09 19 47

r1tsuu
r1tsuu previously approved these changes Jun 10, 2025
@JarrodMFlesch JarrodMFlesch merged commit 254ffec into main Jun 10, 2025
77 checks passed
@JarrodMFlesch JarrodMFlesch deleted the fix/12628 branch June 10, 2025 14:08
elliott-w pushed a commit to elliott-w/payload that referenced this pull request Jun 12, 2025
Fixes payloadcms#12628

When using sqlite, the error from the db is a bit different than
Postgres.

This PR allows us to extract the fieldName when using sqlite for the
unique constraint error.
Copy link
Contributor

🚀 This is included in version v3.43.0

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

Successfully merging this pull request may close these issues.

UNIQUE constraint failed: No proper error message in the ui
2 participants