Table of Contents

Class CreateTableOptionsBuilder

Namespace
NextORM.Core
Assembly
nextorm.core.dll

Fluent builder for CreateTableOptions. Every setter returns the builder, so options can be composed inline at a materialisation terminal, for example ToTable("t", o => o.DropExisting()). A rule that depends on the target form (temporary vs persistent) is checked when the statement is built; the contradictory combination is already rejected by Build().

public sealed class CreateTableOptionsBuilder
Inheritance
CreateTableOptionsBuilder
Inherited Members
Extension Methods

Methods

Build()

Builds the immutable options and rejects the combination that is invalid regardless of the target form.

public CreateTableOptions Build()

Returns

CreateTableOptions

The configured options.

Exceptions

ArgumentException

DropExisting and IfNotExists are both set.

Columns(params string[])

Declares the target column names instead of deriving them from the query.

public CreateTableOptionsBuilder Columns(params string[] names)

Parameters

names string[]

The column names, in order; must not be empty and must not contain null or empty entries.

Returns

CreateTableOptionsBuilder

This builder, for chaining.

Exceptions

ArgumentNullException

names is null.

ArgumentException

names is empty or contains a null or empty entry.

DropExisting(bool)

Drops an existing table with the target name first (DROP TABLE IF EXISTS), so the materialisation always reflects the current query. Persistent tables only; mutually exclusive with IfNotExists(bool).

public CreateTableOptionsBuilder DropExisting(bool value = true)

Parameters

value bool

Whether to drop the existing table; defaults to true.

Returns

CreateTableOptionsBuilder

This builder, for chaining.

IfNotExists(bool)

Adds IF NOT EXISTS, so repeating the statement is a no-op.

public CreateTableOptionsBuilder IfNotExists(bool value = true)

Parameters

value bool

Whether to emit the clause; defaults to true.

Returns

CreateTableOptionsBuilder

This builder, for chaining.

OnCommit(TempTableOnCommit)

Sets the ON COMMIT action of a temporary table (PostgreSQL only).

public CreateTableOptionsBuilder OnCommit(TempTableOnCommit value)

Parameters

value TempTableOnCommit

The commit action; defaults to PreserveRows.

Returns

CreateTableOptionsBuilder

This builder, for chaining.

WithData(bool)

Populates the table from the query.

public CreateTableOptionsBuilder WithData(bool value = true)

Parameters

value bool

false renders WITH NO DATA (PostgreSQL only); defaults to true.

Returns

CreateTableOptionsBuilder

This builder, for chaining.