Table of Contents

Class SqliteObjectCollection

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

Represents a collection of SQL schema objects.

public sealed class SqliteObjectCollection : SqlObjectCollection, ISqlObjectCollection, IReadOnlyCollection<ISqlObject>, IEnumerable<ISqlObject>, IEnumerable
Inheritance
SqliteObjectCollection
Implements
Inherited Members

Remarks

SqliteDialect implementation.

Properties

Schema

Schema that this collection belongs to.

public SqliteSchema Schema { get; }

Property Value

SqliteSchema

Methods

CreateCheck(SqlTable, SqlCheckBuilder)

Creates a new SqlCheck instance.

[Pure]
protected override SqliteCheck CreateCheck(SqlTable table, SqlCheckBuilder builder)

Parameters

table SqlTable

Table that this check constraint is attached to.

builder SqlCheckBuilder

Source check builder.

Returns

SqliteCheck

New SqlCheck instance.

CreateForeignKey(SqlIndex, SqlIndex, SqlForeignKeyBuilder)

Creates a new SqlForeignKey instance.

[Pure]
protected override SqliteForeignKey CreateForeignKey(SqlIndex originIndex, SqlIndex referencedIndex, SqlForeignKeyBuilder builder)

Parameters

originIndex SqlIndex

SQL index that this foreign key originates from.

referencedIndex SqlIndex

SQL index referenced by this foreign key.

builder SqlForeignKeyBuilder

Source foreign key builder.

Returns

SqliteForeignKey

New SqlForeignKey instance.

CreateIndex(SqlTable, SqlIndexBuilder)

Creates a new SqlIndex instance.

[Pure]
protected override SqliteIndex CreateIndex(SqlTable table, SqlIndexBuilder builder)

Parameters

table SqlTable

Table that this index belongs to.

builder SqlIndexBuilder

Source index builder.

Returns

SqliteIndex

New SqlIndex instance.

CreatePrimaryKey(SqlIndex, SqlPrimaryKeyBuilder)

Creates a new SqlPrimaryKey instance.

[Pure]
protected override SqlitePrimaryKey CreatePrimaryKey(SqlIndex index, SqlPrimaryKeyBuilder builder)

Parameters

index SqlIndex

Underlying index that defines this primary key.

builder SqlPrimaryKeyBuilder

Source primary key builder.

Returns

SqlitePrimaryKey

New SqlPrimaryKey instance.

CreateTable(SqlTableBuilder)

Creates a new SqlTable instance.

[Pure]
protected override SqliteTable CreateTable(SqlTableBuilder builder)

Parameters

builder SqlTableBuilder

Source table builder.

Returns

SqliteTable

New SqlTable instance.

CreateView(SqlViewBuilder)

Creates a new SqlView instance.

[Pure]
protected override SqliteView CreateView(SqlViewBuilder builder)

Parameters

builder SqlViewBuilder

Source view builder.

Returns

SqliteView

New SqlView instance.

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 object 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 object 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 object exists but is not an index.

GetPrimaryKey(string)

Returns a primary key with the provided name.

[Pure]
public SqlitePrimaryKey GetPrimaryKey(string name)

Parameters

name string

Name of the primary key to return.

Returns

SqlitePrimaryKey

Existing primary key.

Exceptions

KeyNotFoundException

When primary key does not exist.

SqlObjectCastException

When object exists but is not a primary key.

GetTable(string)

Returns a table with the provided name.

[Pure]
public SqliteTable GetTable(string name)

Parameters

name string

Name of the table to return.

Returns

SqliteTable

Existing table.

Exceptions

KeyNotFoundException

When table does not exist.

SqlObjectCastException

When object exists but is not a table.

GetView(string)

Returns a view with the provided name.

[Pure]
public SqliteView GetView(string name)

Parameters

name string

Name of the view to return.

Returns

SqliteView

Existing view.

Exceptions

KeyNotFoundException

When view does not exist.

SqlObjectCastException

When object exists but is not a view.

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.

TryGetPrimaryKey(string)

Attempts to return a primary key with the provided name.

[Pure]
public SqlitePrimaryKey? TryGetPrimaryKey(string name)

Parameters

name string

Name of the primary key to return.

Returns

SqlitePrimaryKey

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

TryGetTable(string)

Attempts to return a table with the provided name.

[Pure]
public SqliteTable? TryGetTable(string name)

Parameters

name string

Name of the table to return.

Returns

SqliteTable

Existing table or null when table does not exist.

TryGetView(string)

Attempts to return a view with the provided name.

[Pure]
public SqliteView? TryGetView(string name)

Parameters

name string

Name of the view to return.

Returns

SqliteView

Existing view or null when view does not exist.