Open xamgore opened 3 months ago
Having a schema with defined constraint checks, I'd like to see a meaningful error message.
.check(Expr::col(Products::Price).gt(0))
Without it, all we'll get is:
⛔️ new row for relation "products" violates check constraint "products_check".
Extend the API in a way it could introduce names for constraints.
CREATE TABLE products ( product_no integer, name text, price numeric CONSTRAINT positive_price CHECK (price > 0) -- ^^^^^^^^^^^^^^ );
Matching error messages against those "positive_price" names allows translating them for end users.
"positive_price"
Motivation
Having a schema with defined constraint checks, I'd like to see a meaningful error message.
Without it, all we'll get is:
Proposed Solutions
Extend the API in a way it could introduce names for constraints.
Matching error messages against those
"positive_price"
names allows translating them for end users.