Table of Contents

Class CreateTableOptions

Namespace
LinqToDB
Assembly
linq2db.dll

Options for creating a table.

public record CreateTableOptions : IEquatable<CreateTableOptions>
Inheritance
CreateTableOptions
Implements
Derived
Inherited Members
Extension Methods

Constructors

CreateTableOptions(CreateTableOptions)

protected CreateTableOptions(CreateTableOptions original)

Parameters

original CreateTableOptions

CreateTableOptions(string?, string?, string?, string?, string?, string?, TableOptions, DefaultNullable)

Options for creating a table.

public CreateTableOptions(string? TableName = null, string? DatabaseName = null, string? SchemaName = null, string? ServerName = null, string? StatementHeader = null, string? StatementFooter = null, TableOptions TableOptions = TableOptions.None, DefaultNullable DefaultNullable = DefaultNullable.None)

Parameters

TableName string

Optional name of table. If not specified, value from mapping will be used.

DatabaseName string

Optional name of table's database. If not specified, value from mapping will be used.

SchemaName string

Optional name of table schema/owner. If not specified, value from mapping will be used.

ServerName string

Optional name of linked server. If not specified, value from mapping will be used.

StatementHeader string

Replacement for "CREATE TABLE table_name" header. Header is a template with {0} parameter for table name.

StatementFooter string

SQL appended to the generated create table statement.

TableOptions TableOptions

Optional Table options. Default is None.

DefaultNullable DefaultNullable

Defines how columns nullability flag should be generated:

- Null - generate only NOT NULL for non-nullable fields. Missing nullability information treated as NULL by database.

- NotNull - generate only NULL for nullable fields. Missing nullability information treated as NOT NULL by database.

- None - explicitly generate NULL and NOT NULL for all columns.

Default value: None.

Properties

DatabaseName

Optional name of table's database. If not specified, value from mapping will be used.

public string? DatabaseName { get; init; }

Property Value

string

DefaultNullable

Defines how columns nullability flag should be generated:

- Null - generate only NOT NULL for non-nullable fields. Missing nullability information treated as NULL by database.

- NotNull - generate only NULL for nullable fields. Missing nullability information treated as NOT NULL by database.

- None - explicitly generate NULL and NOT NULL for all columns.

Default value: None.
public DefaultNullable DefaultNullable { get; init; }

Property Value

DefaultNullable

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

SchemaName

Optional name of table schema/owner. If not specified, value from mapping will be used.

public string? SchemaName { get; init; }

Property Value

string

ServerName

Optional name of linked server. If not specified, value from mapping will be used.

public string? ServerName { get; init; }

Property Value

string

StatementFooter

SQL appended to the generated create table statement.

public string? StatementFooter { get; init; }

Property Value

string

StatementHeader

Replacement for "CREATE TABLE table_name" header. Header is a template with {0} parameter for table name.

public string? StatementHeader { get; init; }

Property Value

string

TableName

Optional name of table. If not specified, value from mapping will be used.

public string? TableName { get; init; }

Property Value

string

TableOptions

Optional Table options. Default is None.

public TableOptions TableOptions { get; init; }

Property Value

TableOptions

Methods

Deconstruct(out string?, out string?, out string?, out string?, out string?, out string?, out TableOptions, out DefaultNullable)

public void Deconstruct(out string? TableName, out string? DatabaseName, out string? SchemaName, out string? ServerName, out string? StatementHeader, out string? StatementFooter, out TableOptions TableOptions, out DefaultNullable DefaultNullable)

Parameters

TableName string
DatabaseName string
SchemaName string
ServerName string
StatementHeader string
StatementFooter string
TableOptions TableOptions
DefaultNullable DefaultNullable

Equals(CreateTableOptions?)

public virtual bool Equals(CreateTableOptions? other)

Parameters

other CreateTableOptions

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

Operators

operator ==(CreateTableOptions?, CreateTableOptions?)

public static bool operator ==(CreateTableOptions? left, CreateTableOptions? right)

Parameters

left CreateTableOptions
right CreateTableOptions

Returns

bool

operator !=(CreateTableOptions?, CreateTableOptions?)

public static bool operator !=(CreateTableOptions? left, CreateTableOptions? right)

Parameters

left CreateTableOptions
right CreateTableOptions

Returns

bool