Table of Contents

Class IndexAttribute

Namespace
Typhon.Schema.Definition
Assembly
Typhon.Schema.Definition.dll

Marks a component field for indexing, maintaining a B+Tree index over the field's values for lookups and range scans.

[AttributeUsage(AttributeTargets.Field)]
public sealed class IndexAttribute : Attribute
Inheritance
IndexAttribute
Inherited Members

Constructors

IndexAttribute()

public IndexAttribute()

Properties

AllowMultiple

true for a non-unique index (many entities may share a key value); false (default) for a unique index (one entity per key).

public bool AllowMultiple { get; set; }

Property Value

bool

OnParentDelete

Cascade action when the parent entity (referenced by an EntityLink<T> FK field) is deleted. Only applicable to indexed EntityLink fields. Default is None.

public CascadeAction OnParentDelete { get; set; }

Property Value

CascadeAction

Sparse

true for a sparse index: an entity whose key is 0 — "no data", the engine's rule for an optional value — is not indexed at all, so an index over a field most entities leave at 0 costs only the entities that set it. A query whose range admits 0 is answered from the data, never the tree; the raw index enumeration never yields key 0. A unique sparse index lets any number of entities hold 0. Integer key types only (byte, short, int, long, their unsigned forms, and char).

public bool Sparse { get; set; }

Property Value

bool