Table of Contents

Interface ISqlColumnBuilder

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

Represents an SQL table column builder.

public interface ISqlColumnBuilder : ISqlObjectBuilder
Inherited Members
Extension Methods

Properties

Computation

Underlying optional SqlColumnComputation of this column.

SqlColumnComputation? Computation { get; }

Property Value

SqlColumnComputation?

DefaultValue

Underlying optional default value expression.

SqlExpressionNode? DefaultValue { get; }

Property Value

SqlExpressionNode

IsNullable

Specifies whether or not this column accepts null values.

bool IsNullable { get; }

Property Value

bool

Node

Underlying SqlColumnBuilderNode instance that represents this column.

SqlColumnBuilderNode Node { get; }

Property Value

SqlColumnBuilderNode

ReferencedComputationColumns

Collection of columns referenced by this column's Computation.

IReadOnlyCollection<ISqlColumnBuilder> ReferencedComputationColumns { get; }

Property Value

IReadOnlyCollection<ISqlColumnBuilder>

Table

Table that this column belongs to.

ISqlTableBuilder Table { get; }

Property Value

ISqlTableBuilder

TypeDefinition

ISqlColumnTypeDefinition instance that defines the data type of this column.

ISqlColumnTypeDefinition TypeDefinition { get; }

Property Value

ISqlColumnTypeDefinition

Methods

Asc()

Creates a new SqlOrderByNode instance from this column with Asc ordering.

[Pure]
SqlOrderByNode Asc()

Returns

SqlOrderByNode

New SqlOrderByNode instance.

Desc()

Creates a new SqlOrderByNode instance from this column with Desc ordering.

[Pure]
SqlOrderByNode Desc()

Returns

SqlOrderByNode

New SqlOrderByNode instance.

MarkAsNullable(bool)

Changes IsNullable value of this column.

ISqlColumnBuilder MarkAsNullable(bool enabled = true)

Parameters

enabled bool

Value to set. Equal to true by default.

Returns

ISqlColumnBuilder

this.

Exceptions

SqlObjectBuilderException

When nullability cannot be changed.

SetComputation(SqlColumnComputation?)

Changes Computation value of this column.

ISqlColumnBuilder SetComputation(SqlColumnComputation? computation)

Parameters

computation SqlColumnComputation?

Value to set.

Returns

ISqlColumnBuilder

this.

Remarks

Changing the computation to non-null will reset the DefaultValue to null.

Exceptions

SqlObjectBuilderException

When computation cannot be changed.

SetDefaultValue(SqlExpressionNode?)

Changes DefaultValue value of this column.

ISqlColumnBuilder SetDefaultValue(SqlExpressionNode? value)

Parameters

value SqlExpressionNode

Value to set.

Returns

ISqlColumnBuilder

this.

Exceptions

SqlObjectBuilderException

When default value cannot be changed.

SetName(string)

Changes the name of this object.

ISqlColumnBuilder SetName(string name)

Parameters

name string

Name to set.

Returns

ISqlColumnBuilder

this.

Exceptions

SqlObjectBuilderException

When name cannot be changed.

SetType(ISqlColumnTypeDefinition)

Changes TypeDefinition value of this column.

ISqlColumnBuilder SetType(ISqlColumnTypeDefinition definition)

Parameters

definition ISqlColumnTypeDefinition

Value to set.

Returns

ISqlColumnBuilder

this.

Remarks

Changing the type will reset the DefaultValue to null.

Exceptions

SqlObjectBuilderException

When type definition cannot be changed.