(error: unknown): boolean Check if an error is a PostgreSQL unique constraint violation (error code 23505).
error
the caught error
type
unknownreturns
boolean true if the error is a unique constraint violation
PostgreSQL error utilities.
Works with both pg and @electric-sql/pglite — both set .code
on error objects using standard PostgreSQL error codes.
(error: unknown): boolean Check if an error is a PostgreSQL unique constraint violation (error code 23505).
errorthe caught error
unknownboolean true if the error is a unique constraint violation