Table of Contents

Class SqliteObjectBuilderCollection

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

Represents a collection of SQL schema object builders.

public sealed class SqliteObjectBuilderCollection : SqlObjectBuilderCollection, ISqlObjectBuilderCollection, IReadOnlyCollection<ISqlObjectBuilder>, IEnumerable<ISqlObjectBuilder>, IEnumerable
Inheritance
SqliteObjectBuilderCollection
Implements
Inherited Members

Remarks

SqliteDialect implementation.

Properties

Schema

Schema that this collection belongs to.

public SqliteSchemaBuilder Schema { get; }

Property Value

SqliteSchemaBuilder

Methods

CreateCheckBuilder(SqlTableBuilder, string, SqlConditionNode, ReadOnlyArray<SqlColumnBuilder>)

Creates a new SqlCheckBuilder instance.

protected override SqliteCheckBuilder CreateCheckBuilder(SqlTableBuilder table, string name, SqlConditionNode condition, ReadOnlyArray<SqlColumnBuilder> referencedColumns)

Parameters

table SqlTableBuilder

Table that this check is attached to.

name string

Check's name.

condition SqlConditionNode

Underlying condition of this check constraint.

referencedColumns ReadOnlyArray<SqlColumnBuilder>

Collection of columns referenced by this check constraint.

Returns

SqliteCheckBuilder

New SqlCheckBuilder instance.

CreateForeignKeyBuilder(string, SqlIndexBuilder, SqlIndexBuilder)

Creates a new SqlForeignKeyBuilder instance.

protected override SqliteForeignKeyBuilder CreateForeignKeyBuilder(string name, SqlIndexBuilder originIndex, SqlIndexBuilder referencedIndex)

Parameters

name string

Foreign key's name.

originIndex SqlIndexBuilder

SQL index that this foreign key originates from.

referencedIndex SqlIndexBuilder

SQL index referenced by this foreign key.

Returns

SqliteForeignKeyBuilder

New SqlForeignKeyBuilder instance.

CreateIndexBuilder(SqlTableBuilder, string, SqlIndexBuilderColumns<SqlColumnBuilder>, bool, ReadOnlyArray<SqlColumnBuilder>)

Creates a new SqlIndexBuilder instance.

protected override SqliteIndexBuilder CreateIndexBuilder(SqlTableBuilder table, string name, SqlIndexBuilderColumns<SqlColumnBuilder> columns, bool isUnique, ReadOnlyArray<SqlColumnBuilder> referencedColumns)

Parameters

table SqlTableBuilder

Table that this index is attached to.

name string

Index's name.

columns SqlIndexBuilderColumns<SqlColumnBuilder>

Collection of columns that define this index.

isUnique bool

Specifies whether this index is unique.

referencedColumns ReadOnlyArray<SqlColumnBuilder>

Collection of columns referenced by this index's Columns.

Returns

SqliteIndexBuilder

New SqlIndexBuilder instance.

CreatePrimaryKeyBuilder(string, SqlIndexBuilder)

Creates a new SqlPrimaryKeyBuilder instance.

protected override SqlitePrimaryKeyBuilder CreatePrimaryKeyBuilder(string name, SqlIndexBuilder index)

Parameters

name string

Primary key's name.

index SqlIndexBuilder

Underlying index that defines this primary key.

Returns

SqlitePrimaryKeyBuilder

New SqlPrimaryKeyBuilder instance.

CreateTable(string)

Creates a new table builder.

public SqliteTableBuilder CreateTable(string name)

Parameters

name string

Name of the table.

Returns

SqliteTableBuilder

New ISqlTableBuilder instance.

Exceptions

SqlObjectBuilderException

When table could not be created.

CreateTableBuilder(string)

Creates a new SqlTableBuilder instance.

protected override SqliteTableBuilder CreateTableBuilder(string name)

Parameters

name string

Table's name.

Returns

SqliteTableBuilder

New SqlTableBuilder instance

CreateView(string, SqlQueryExpressionNode)

Creates a new view builder.

public SqliteViewBuilder CreateView(string name, SqlQueryExpressionNode source)

Parameters

name string

Name of the view.

source SqlQueryExpressionNode

Underlying source query expression that defines the view.

Returns

SqliteViewBuilder

New ISqlViewBuilder instance.

Exceptions

SqlObjectBuilderException

When view could not be created.

CreateViewBuilder(string, SqlQueryExpressionNode, ReadOnlyArray<SqlObjectBuilder>)

Creates a new SqlViewBuilder instance.

protected override SqliteViewBuilder CreateViewBuilder(string name, SqlQueryExpressionNode source, ReadOnlyArray<SqlObjectBuilder> referencedObjects)

Parameters

name string

View's name.

source SqlQueryExpressionNode

Underlying source query expression that defines this view.

referencedObjects ReadOnlyArray<SqlObjectBuilder>

Collection of objects (tables, views and columns) referenced by this view's Source.

Returns

SqliteViewBuilder

New SqlViewBuilder instance

GetCheck(string)

Returns a check with the provided name.

[Pure]
public SqliteCheckBuilder GetCheck(string name)

Parameters

name string

Name of the check to return.

Returns

SqliteCheckBuilder

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 SqliteForeignKeyBuilder GetForeignKey(string name)

Parameters

name string

Name of the foreign key to return.

Returns

SqliteForeignKeyBuilder

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 SqliteIndexBuilder GetIndex(string name)

Parameters

name string

Name of the index to return.

Returns

SqliteIndexBuilder

Existing index.

Exceptions

KeyNotFoundException

When index does not exist.

SqlObjectCastException

When object exists but is not an index.

GetOrCreateTable(string)

Creates a new table builder or returns an existing table builder.

public SqliteTableBuilder GetOrCreateTable(string name)

Parameters

name string

Name of the table.

Returns

SqliteTableBuilder

New ISqlTableBuilder instance or an existing table builder.

Exceptions

SqlObjectBuilderException

When table does not exist and could not be created.

GetPrimaryKey(string)

Returns a primary key with the provided name.

[Pure]
public SqlitePrimaryKeyBuilder GetPrimaryKey(string name)

Parameters

name string

Name of the primary key to return.

Returns

SqlitePrimaryKeyBuilder

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 SqliteTableBuilder GetTable(string name)

Parameters

name string

Name of the table to return.

Returns

SqliteTableBuilder

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 SqliteViewBuilder GetView(string name)

Parameters

name string

Name of the view to return.

Returns

SqliteViewBuilder

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 SqliteCheckBuilder? TryGetCheck(string name)

Parameters

name string

Name of the check to return.

Returns

SqliteCheckBuilder

Existing check or null when check does not exist.

TryGetForeignKey(string)

Attempts to return a foreign key with the provided name.

[Pure]
public SqliteForeignKeyBuilder? TryGetForeignKey(string name)

Parameters

name string

Name of the foreign key to return.

Returns

SqliteForeignKeyBuilder

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

TryGetIndex(string)

Attempts to return an index with the provided name.

[Pure]
public SqliteIndexBuilder? TryGetIndex(string name)

Parameters

name string

Name of the index to return.

Returns

SqliteIndexBuilder

Existing index or null when index does not exist.

TryGetPrimaryKey(string)

Attempts to return a primary key with the provided name.

[Pure]
public SqlitePrimaryKeyBuilder? TryGetPrimaryKey(string name)

Parameters

name string

Name of the primary key to return.

Returns

SqlitePrimaryKeyBuilder

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

TryGetTable(string)

Attempts to return a table with the provided name.

[Pure]
public SqliteTableBuilder? TryGetTable(string name)

Parameters

name string

Name of the table to return.

Returns

SqliteTableBuilder

Existing table or null when table does not exist.

TryGetView(string)

Attempts to return a view with the provided name.

[Pure]
public SqliteViewBuilder? TryGetView(string name)

Parameters

name string

Name of the view to return.

Returns

SqliteViewBuilder

Existing view or null when view does not exist.