Skip to content

PgEqualityAttribute

Namespace: Ankus

Assembly: Ankus.Runtime.dll

Generates PostgreSQL equality and inequality operators from IEquatable of the declared type. Enum declarations use their underlying numeric equality.

[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Enum, Inherited = false)]
public sealed class PgEqualityAttribute : Attribute

Requires PgType, PgEnum, or a PgDatumType mapping with a reader. A mapped writer is not required. Equality and any mapped reader must be immutable and parallel safe; equality must be an equivalence relation. Generated functions are strict and never pass SQL NULL to managed comparisons. Add PgOrdering or PgHashing to generate compatible default index operator classes. Generated objects use the mapped SQL type’s schema; fixed-schema objects prevent extension relocation.

Inheritance: object, Attribute

public PgEqualityAttribute()

Gets or sets the installation dependency identifier for the generated equality operators.

public string? Id { get; set; }

Value: string

Gets or sets installation entities that must precede the generated equality operators.

public string[] Requires { get; set; }

Value: string[]