Class PostgreSqlColumnBuilderCollection
- Namespace
- LfrlAnvil.PostgreSql.Objects.Builders
- Assembly
- LfrlAnvil.PostgreSql.dll
Represents a collection of SQL table column builders.
public sealed class PostgreSqlColumnBuilderCollection : SqlColumnBuilderCollection, ISqlColumnBuilderCollection, IReadOnlyCollection<ISqlColumnBuilder>, IEnumerable<ISqlColumnBuilder>, IEnumerable
- Inheritance
-
PostgreSqlColumnBuilderCollection
- Implements
- Inherited Members
Remarks
PostgreSqlDialect implementation.
Properties
Table
Table that this collection belongs to.
public PostgreSqlTableBuilder Table { get; }
Property Value
Methods
Create(string)
Creates a new column builder.
public PostgreSqlColumnBuilder Create(string name)
Parameters
name
stringName of the column.
Returns
- PostgreSqlColumnBuilder
New ISqlColumnBuilder instance.
Exceptions
- SqlObjectBuilderException
When column could not be created.
CreateColumnBuilder(string)
Creates a new SqlColumnBuilder instance.
protected override PostgreSqlColumnBuilder CreateColumnBuilder(string name)
Parameters
name
stringColumn's name.
Returns
- PostgreSqlColumnBuilder
New SqlColumnBuilder instance.
Get(string)
Returns a column with the provided name
.
[Pure]
public PostgreSqlColumnBuilder Get(string name)
Parameters
name
stringName of the column to return.
Returns
- PostgreSqlColumnBuilder
Existing column.
Exceptions
- KeyNotFoundException
When column does not exist.
GetEnumerator()
Creates a new SqlObjectBuilderEnumerator<TSource, TDestination> instance for this collection.
[Pure]
public SqlObjectBuilderEnumerator<SqlColumnBuilder, PostgreSqlColumnBuilder> GetEnumerator()
Returns
- SqlObjectBuilderEnumerator<SqlColumnBuilder, PostgreSqlColumnBuilder>
New SqlObjectBuilderEnumerator<TSource, TDestination> instance.
GetOrCreate(string)
Creates a new column builder or returns an existing column builder.
public PostgreSqlColumnBuilder GetOrCreate(string name)
Parameters
name
stringName of the column.
Returns
- PostgreSqlColumnBuilder
New ISqlColumnBuilder instance or an existing column builder.
Exceptions
- SqlObjectBuilderException
When column does not exist and could not be created.
SetDefaultTypeDefinition(SqlColumnTypeDefinition)
Changes DefaultTypeDefinition value of this collection.
public PostgreSqlColumnBuilderCollection SetDefaultTypeDefinition(SqlColumnTypeDefinition definition)
Parameters
definition
SqlColumnTypeDefinitionValue to set.
Returns
Exceptions
- SqlObjectBuilderException
When
definition
is not valid.
TryGet(string)
Attempts to return a column with the provided name
.
[Pure]
public PostgreSqlColumnBuilder? TryGet(string name)
Parameters
name
stringName of the column to return.
Returns
- PostgreSqlColumnBuilder
Existing column or null when column does not exist.