Class SqlSchemaCollection
Represents a collection of SQL schemas.
public abstract class SqlSchemaCollection : ISqlSchemaCollection, IReadOnlyCollection<ISqlSchema>, IEnumerable<ISqlSchema>, IEnumerable
- Inheritance
-
SqlSchemaCollection
- Implements
- Derived
- Inherited Members
Constructors
SqlSchemaCollection(SqlSchemaBuilderCollection)
Creates a new SqlSchemaCollection instance.
protected SqlSchemaCollection(SqlSchemaBuilderCollection source)
Parameters
source
SqlSchemaBuilderCollectionSource collection.
Properties
Count
Gets the number of elements in the collection.
public int Count { get; }
Property Value
- int
The number of elements in the collection.
Database
Database that this collection belongs to.
public SqlDatabase Database { get; }
Property Value
Default
Default schema.
public SqlSchema Default { get; }
Property Value
Methods
Contains(string)
Checks whether or not a schema with the provided name
exists.
[Pure]
public bool Contains(string name)
Parameters
name
stringName to check.
Returns
- bool
true when schema exists, otherwise false.
CreateSchema(SqlSchemaBuilder)
Creates a new SqlSchema instance.
[Pure]
protected abstract SqlSchema CreateSchema(SqlSchemaBuilder builder)
Parameters
builder
SqlSchemaBuilderSource schema builder.
Returns
Get(string)
Returns a schema with the provided name
.
[Pure]
public SqlSchema Get(string name)
Parameters
name
stringName of the schema to return.
Returns
- SqlSchema
Existing schema.
Exceptions
- KeyNotFoundException
When schema does not exist.
GetEnumerator()
Creates a new SqlObjectEnumerator<T> instance for this collection.
[Pure]
public SqlObjectEnumerator<SqlSchema> GetEnumerator()
Returns
- SqlObjectEnumerator<SqlSchema>
New SqlObjectEnumerator<T> instance.
GetSchemaFromUnknown(SqlObjectBuilder)
Extracts an SqlSchemaBuilder instance from an UnknownSqlObjectBuilder instance.
[Pure]
protected virtual SqlSchemaBuilder GetSchemaFromUnknown(SqlObjectBuilder builder)
Parameters
builder
SqlObjectBuilderSource builder.
Returns
- SqlSchemaBuilder
Extracted SqlSchemaBuilder instance.
Exceptions
- NotSupportedException
This method is not supported by default.
TryGet(string)
Attempts to return a schema with the provided name
.
[Pure]
public SqlSchema? TryGet(string name)
Parameters
name
stringName of the schema to return.
Returns
- SqlSchema
Existing schema or null when schema does not exist.