-
-
Notifications
You must be signed in to change notification settings - Fork 214
Closed
Description
Motivation
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".
Proposed Solutions
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.
Metadata
Metadata
Assignees
Labels
No labels