Class SqliteObjectBuilderCollection
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
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
tableSqlTableBuilderTable that this check is attached to.
namestringCheck's name.
conditionSqlConditionNodeUnderlying condition of this check constraint.
referencedColumnsReadOnlyArray<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
namestringForeign key's name.
originIndexSqlIndexBuilderSQL index that this foreign key originates from.
referencedIndexSqlIndexBuilderSQL 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
tableSqlTableBuilderTable that this index is attached to.
namestringIndex's name.
columnsSqlIndexBuilderColumns<SqlColumnBuilder>Collection of columns that define this index.
isUniqueboolSpecifies whether this index is unique.
referencedColumnsReadOnlyArray<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
namestringPrimary key's name.
indexSqlIndexBuilderUnderlying index that defines this primary key.
Returns
- SqlitePrimaryKeyBuilder
New SqlPrimaryKeyBuilder instance.
CreateTable(string)
Creates a new table builder.
public SqliteTableBuilder CreateTable(string name)
Parameters
namestringName 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
namestringTable's name.
Returns
- SqliteTableBuilder
New SqlTableBuilder instance
CreateView(string, SqlQueryExpressionNode)
Creates a new view builder.
public SqliteViewBuilder CreateView(string name, SqlQueryExpressionNode source)
Parameters
namestringName of the view.
sourceSqlQueryExpressionNodeUnderlying 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
namestringView's name.
sourceSqlQueryExpressionNodeUnderlying source query expression that defines this view.
referencedObjectsReadOnlyArray<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
namestringName 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
namestringName 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
namestringName 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
namestringName 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
namestringName 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
namestringName 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
namestringName 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
namestringName 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
namestringName 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
namestringName 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
namestringName 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
namestringName 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
namestringName of the view to return.
Returns
- SqliteViewBuilder
Existing view or null when view does not exist.