Skip to main content
Version: Preview (0.3.0-preview.205)

Class IdCollations

Namespace: AdCodicem.ValueObjects.Identifiers.EntityFrameworkCore
Assembly: AdCodicem.ValueObjects.Identifiers.EntityFrameworkCore.dll

The binary collations worth naming, per provider.

public static class IdCollations

Inheritance​

object ← IdCollations

Inherited Members​

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Remarks​

Applying one is a performance choice, not a correctness one — and that is only true because normalization folds an identifier to a single canonical spelling before it is ever stored. Without that, a case-insensitive collation would collapse two distinct identifiers into one, and a lookup could return the wrong row. With it, the collation only decides how fast the comparison runs.

Binary comparison also matches what the application does in memory, where identifiers compare ordinally, so a query and a sort in code agree on the order.

Fields​

PostgreSql​

Byte-wise comparison on PostgreSQL.

public const string PostgreSql = "C"

Field Value​

string

Remarks​

Also what makes a B-tree index usable by a LIKE 'acc_%' prefix scan.

SqlServer​

Byte-wise comparison on SQL Server.

public const string SqlServer = "Latin1_General_BIN2"

Field Value​

string

Remarks​

Worth setting explicitly: the default collation of a SQL Server database is case insensitive.