Class CreateTableOptionsBuilder
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
namesstring[]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
namesis null.- ArgumentException
namesis 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
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
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
valueTempTableOnCommitThe 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
Returns
- CreateTableOptionsBuilder
This builder, for chaining.