Class Index

Namespace
DbExport.Schema
Assembly
DbExport.Api.dll

Represents a database index associated with a table. An index is used to enhance the performance of database queries by providing quick access to rows in a table based on the values of one or more columns.

public class Index : Key, IVisitorAcceptor, ICheckable
Inheritance
Index
Implements
Inherited Members

Remarks

The Index class inherits from the Key class, which represents a set of columns in the table that define a constraint or relationship. The Index can be unique, primary, or secondary and can be matched against primary or foreign key constraints in the table.

Constructors

Index(Table, string, IEnumerable<string>, bool, bool)

Initializes a new instance of the Index class.

public Index(Table table, string name, IEnumerable<string> columnNames, bool unique, bool primaryKey)

Parameters

table Table

The table that owns the index.

name string

The name of the index.

columnNames IEnumerable<string>

The names of the columns that make up the index.

unique bool

Whether the index is unique.

primaryKey bool

Whether the index is a primary key.

Properties

IsPrimaryKey

Gets a value indicating whether the index is a primary key.

public bool IsPrimaryKey { get; }

Property Value

bool

IsUnique

Gets a value indicating whether the index is unique.

public bool IsUnique { get; }

Property Value

bool

MatchesForeignKey

Gets a value indicating whether the index matches a foreign key constraint.

public bool MatchesForeignKey { get; }

Property Value

bool

MatchesKey

Gets a value indicating whether the index matches a primary or foreign key constraint.

public bool MatchesKey { get; }

Property Value

bool

MatchesPrimaryKey

Gets a value indicating whether the index matches a primary key constraint.

public bool MatchesPrimaryKey { get; }

Property Value

bool

Methods

AcceptVisitor(IVisitor)

Accepts a visitor, allowing it to perform operations on the implementing class. The visitor will typically have specific methods for handling different types of elements in the object structure.

public override void AcceptVisitor(IVisitor visitor)

Parameters

visitor IVisitor

The visitor instance that will perform operations on the implementing class.