Table of Contents

Interface ISqlColumnBuilderCollection

Namespace
LfrlAnvil.Sql.Objects.Builders
Assembly
LfrlAnvil.Sql.Core.dll

Represents a collection of SQL table column builders.

public interface ISqlColumnBuilderCollection : IReadOnlyCollection<ISqlColumnBuilder>, IEnumerable<ISqlColumnBuilder>, IEnumerable
Inherited Members
Extension Methods

Properties

DefaultTypeDefinition

Specifies the default ISqlColumnTypeDefinition of newly created columns.

ISqlColumnTypeDefinition DefaultTypeDefinition { get; }

Property Value

ISqlColumnTypeDefinition

Table

Table that this collection belongs to.

ISqlTableBuilder Table { get; }

Property Value

ISqlTableBuilder

Methods

Contains(string)

Checks whether or not a column with the provided name exists.

[Pure]
bool Contains(string name)

Parameters

name string

Name to check.

Returns

bool

true when column exists, otherwise false.

Create(string)

Creates a new column builder.

ISqlColumnBuilder Create(string name)

Parameters

name string

Name of the column.

Returns

ISqlColumnBuilder

New ISqlColumnBuilder instance.

Exceptions

SqlObjectBuilderException

When column could not be created.

Get(string)

Returns a column with the provided name.

[Pure]
ISqlColumnBuilder Get(string name)

Parameters

name string

Name of the column to return.

Returns

ISqlColumnBuilder

Existing column.

Exceptions

KeyNotFoundException

When column does not exist.

GetOrCreate(string)

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

ISqlColumnBuilder GetOrCreate(string name)

Parameters

name string

Name of the column.

Returns

ISqlColumnBuilder

New ISqlColumnBuilder instance or an existing column builder.

Exceptions

SqlObjectBuilderException

When column does not exist and could not be created.

Remove(string)

Attempts to remove a column by its name.

bool Remove(string name)

Parameters

name string

Name of the column to remove.

Returns

bool

true when column was removed, otherwise false.

SetDefaultTypeDefinition(ISqlColumnTypeDefinition)

Changes DefaultTypeDefinition value of this collection.

ISqlColumnBuilderCollection SetDefaultTypeDefinition(ISqlColumnTypeDefinition definition)

Parameters

definition ISqlColumnTypeDefinition

Value to set.

Returns

ISqlColumnBuilderCollection

this.

Exceptions

SqlObjectBuilderException

When definition is not valid.

TryGet(string)

Attempts to return a column with the provided name.

[Pure]
ISqlColumnBuilder? TryGet(string name)

Parameters

name string

Name of the column to return.

Returns

ISqlColumnBuilder

Existing column or null when column does not exist.