Table of Contents

Class SqliteConstraintCollection

Namespace
LfrlAnvil.Sqlite.Objects
Assembly
LfrlAnvil.Sqlite.dll

Represents a collection of SQL table constraints.

public sealed class SqliteConstraintCollection : SqlConstraintCollection, ISqlConstraintCollection, IReadOnlyCollection<ISqlConstraint>, IEnumerable<ISqlConstraint>, IEnumerable
Inheritance
SqliteConstraintCollection
Implements
Inherited Members

Remarks

SqliteDialect implementation.

Properties

PrimaryKey

Table's primary key constraint.

public SqlitePrimaryKey PrimaryKey { get; }

Property Value

SqlitePrimaryKey

Table

Table that this collection belongs to.

public SqliteTable Table { get; }

Property Value

SqliteTable

Methods

GetCheck(string)

Returns a check with the provided name.

[Pure]
public SqliteCheck GetCheck(string name)

Parameters

name string

Name of the check to return.

Returns

SqliteCheck

Existing check.

Exceptions

KeyNotFoundException

When check does not exist.

SqlObjectCastException

When constraint exists but is not a check.

GetForeignKey(string)

Returns a foreign key with the provided name.

[Pure]
public SqliteForeignKey GetForeignKey(string name)

Parameters

name string

Name of the foreign key to return.

Returns

SqliteForeignKey

Existing foreign key.

Exceptions

KeyNotFoundException

When foreign key does not exist.

SqlObjectCastException

When constraint exists but is not a foreign key.

GetIndex(string)

Returns an index with the provided name.

[Pure]
public SqliteIndex GetIndex(string name)

Parameters

name string

Name of the index to return.

Returns

SqliteIndex

Existing index.

Exceptions

KeyNotFoundException

When index does not exist.

SqlObjectCastException

When constraint exists but is not an index.

TryGetCheck(string)

Attempts to return a check with the provided name.

[Pure]
public SqliteCheck? TryGetCheck(string name)

Parameters

name string

Name of the check to return.

Returns

SqliteCheck

Existing check or null when check does not exist.

TryGetForeignKey(string)

Attempts to return a foreign key with the provided name.

[Pure]
public SqliteForeignKey? TryGetForeignKey(string name)

Parameters

name string

Name of the foreign key to return.

Returns

SqliteForeignKey

Existing foreign key or null when foreign key does not exist.

TryGetIndex(string)

Attempts to return an index with the provided name.

[Pure]
public SqliteIndex? TryGetIndex(string name)

Parameters

name string

Name of the index to return.

Returns

SqliteIndex

Existing index or null when index does not exist.