Class RedbUniqueViolationException
A save was rejected because a [RedbUnique] key is already taken by another object of the
scheme. Raised in place of the driver's own unique-violation error (PostgreSQL 23505, SQL Server
2601/2627, SQLite 2067) so that callers can catch one type on every provider and read which key
collided, rather than match on message text.
Everything but is best-effort: the driver message names the index and, on
PostgreSQL and SQL Server, the key tuple — from which the structure and therefore the scheme and
property are resolved. SQLite names only the columns. When something could not be resolved the
property is null; the original exception is always attached.
public class RedbUniqueViolationException : Exception, ISerializable
Inheritance
Implements
Properties
ConstraintName
Name of the unique index or constraint the database reported, when it did.
public string? ConstraintName { get; }
Detail
The driver's own detail line (PostgreSQL DETAIL, SQL Server message), verbatim.
public string? Detail { get; }
Kind
Which unique index rejected the save - the object key (ValueUnique) or a
public RedbUniqueViolationKind Kind { get; }
StructureId
Structure (field) whose key collided, when the driver reported the key tuple.
public long? StructureId { get; }