function isUniqueViolation(err) {
  if (!err || typeof err !== "object") return false;
  const code = err.code;
  if (code === "23505") return true;
  const message = err.message;
  return typeof message === "string" && /duplicate key value|unique constraint/i.test(message);
}
export {
  isUniqueViolation
};
//# sourceMappingURL=pg-errors.js.map
