Skip to content

Please add "gorm.ErrUniqueViolation" support #5651

@silvioprog

Description

@silvioprog

Describe the feature

A new error type like gorm.ErrUniqueViolation would allow handling errors related to unique violation.

Motivation

Since GORM allows handling common DB errors, it would be nice to support handling errors related to unique violation too.

Related Issues

  1. How to check if error type is DUPLICATE KEY #4037
  2. POSTGRES How to check if error type is DUPLICATE KEY #4135

Also this at StackOverflow:

GORM create record that might already exist

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions