Class CreateTableOptions
- Namespace
- LinqToDB
- Assembly
- linq2db.dll
Options for creating a table.
public record CreateTableOptions : IEquatable<CreateTableOptions>
- Inheritance
-
objectCreateTableOptions
- Implements
- Derived
- Extension Methods
Constructors
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
TableNamestringOptional name of table. If not specified, value from mapping will be used.
DatabaseNamestringOptional name of table's database. If not specified, value from mapping will be used.
SchemaNamestringOptional name of table schema/owner. If not specified, value from mapping will be used.
ServerNamestringOptional name of linked server. If not specified, value from mapping will be used.
StatementHeaderstringReplacement for
"CREATE TABLE table_name"header. Header is a template with{0}parameter for table name.StatementFooterstringSQL appended to the generated create table statement.
TableOptionsTableOptionsOptional Table options. Default is None.
DefaultNullableDefaultNullableDefines how columns nullability flag should be generated:
- Null - generate only
NOT NULLfor non-nullable fields. Missing nullability information treated asNULLby database.- NotNull - generate only
NULLfor nullable fields. Missing nullability information treated asNOT NULLby database.- None - explicitly generate
Default value: None.NULLandNOT NULLfor all columns.
Properties
DatabaseName
Optional name of table's database. If not specified, value from mapping will be used.
public string? DatabaseName { get; init; }
Property Value
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.
public DefaultNullable DefaultNullable { get; init; }
Property Value
SchemaName
Optional name of table schema/owner. If not specified, value from mapping will be used.
public string? SchemaName { get; init; }
Property Value
ServerName
Optional name of linked server. If not specified, value from mapping will be used.
public string? ServerName { get; init; }
Property Value
StatementFooter
SQL appended to the generated create table statement.
public string? StatementFooter { get; init; }
Property Value
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
TableName
Optional name of table. If not specified, value from mapping will be used.
public string? TableName { get; init; }
Property Value
TableOptions
Optional Table options. Default is None.
public TableOptions TableOptions { get; init; }