Table of Contents

Class PostgreSqlColumnBuilder

Namespace
LfrlAnvil.PostgreSql.Objects.Builders
Assembly
LfrlAnvil.PostgreSql.dll

Represents an SQL table column builder.

public sealed class PostgreSqlColumnBuilder : SqlColumnBuilder, ISqlColumnBuilder, ISqlObjectBuilder
Inheritance
PostgreSqlColumnBuilder
Implements
Inherited Members
Extension Methods

Remarks

PostgreSqlDialect implementation.

Properties

Database

Database that this object belongs to.

public PostgreSqlDatabaseBuilder Database { get; }

Property Value

PostgreSqlDatabaseBuilder

Table

Table that this column belongs to.

public PostgreSqlTableBuilder Table { get; }

Property Value

PostgreSqlTableBuilder

Methods

BeforeComputationChange(SqlColumnComputation?)

Callback invoked just before Computation change is processed.

protected override SqlPropertyChange<SqlColumnComputation?> BeforeComputationChange(SqlColumnComputation? newValue)

Parameters

newValue SqlColumnComputation?

Value to set.

Returns

SqlPropertyChange<SqlColumnComputation?>

SqlPropertyChange<T> instance associated with Computation change attempt.

Exceptions

SqlObjectBuilderException

When Computation of this column cannot be changed.

MarkAsNullable(bool)

Changes IsNullable value of this column.

public PostgreSqlColumnBuilder MarkAsNullable(bool enabled = true)

Parameters

enabled bool

Value to set. Equal to true by default.

Returns

PostgreSqlColumnBuilder

this.

Exceptions

SqlObjectBuilderException

When nullability cannot be changed.

SetComputation(SqlColumnComputation?)

Changes Computation value of this column.

public PostgreSqlColumnBuilder SetComputation(SqlColumnComputation? computation)

Parameters

computation SqlColumnComputation?

Value to set.

Returns

PostgreSqlColumnBuilder

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.

public PostgreSqlColumnBuilder SetDefaultValue(SqlExpressionNode? value)

Parameters

value SqlExpressionNode

Value to set.

Returns

PostgreSqlColumnBuilder

this.

Exceptions

SqlObjectBuilderException

When default value cannot be changed.

SetName(string)

Changes the name of this object.

public PostgreSqlColumnBuilder SetName(string name)

Parameters

name string

Name to set.

Returns

PostgreSqlColumnBuilder

this.

Exceptions

SqlObjectBuilderException

When name cannot be changed.

SetType(SqlColumnTypeDefinition)

Changes TypeDefinition value of this column.

public PostgreSqlColumnBuilder SetType(SqlColumnTypeDefinition definition)

Parameters

definition SqlColumnTypeDefinition

Value to set.

Returns

PostgreSqlColumnBuilder

this.

Remarks

Changing the type will reset the DefaultValue to null.

Exceptions

SqlObjectBuilderException

When type definition cannot be changed.