Class TableDefinition
A definition for a table in a database
Inheritance
object
TableDefinition
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: ETLBox.ControlFlow
Assembly: ETLBox.dll
Syntax
public class TableDefinition
Constructors
TableDefinition()
Declaration
public TableDefinition()
TableDefinition(string, List<TableColumn>)
Declaration
public TableDefinition(string name, List<TableColumn> columns)
Parameters
Type | Name | Description |
---|---|---|
string | name | |
System.Collections.Generic.List<T><TableColumn> | columns |
TableDefinition(string)
Declaration
public TableDefinition(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name |
Properties
Columns
The columns of the table
Declaration
public IList<TableColumn> Columns { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<T><TableColumn> |
ForeignKeyConstraints
Declaration
public ICollection<ForeignKeyConstraint> ForeignKeyConstraints { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<T><ForeignKeyConstraint> |
Name
The name of the table
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
PrimaryKeyConstraintName
The constraint name for the primary key
Declaration
public string PrimaryKeyConstraintName { get; set; }
Property Value
Type | Description |
---|---|
string |
UniqueKeyConstraints
Declaration
public ICollection<UniqueKeyConstraint> UniqueKeyConstraints { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<T><UniqueKeyConstraint> |
Methods
CreateTable()
Uses the CreateTableTask to create a table based on the current definition.
Declaration
public void CreateTable()
CreateTable(IConnectionManager)
Uses the CreateTableTask to create a table based on the current definition.
Declaration
public void CreateTable(IConnectionManager connectionManager)
Parameters
Type | Name | Description |
---|---|---|
IConnectionManager | connectionManager | The connection manager of the database you want to connect |
FromProcedureName(IConnectionManager, string)
Declaration
public static TableDefinition FromProcedureName(IConnectionManager connection, string procedureName)
Parameters
Type | Name | Description |
---|---|---|
IConnectionManager | connection | |
string | procedureName |
Returns
Type | Description |
---|---|
TableDefinition |
FromTableName(IConnectionManager, string, bool)
Gather a table definition from an existing table in the database.
Declaration
public static TableDefinition FromTableName(IConnectionManager connection, string tableName, bool readConstraints = true)
Parameters
Type | Name | Description |
---|---|---|
IConnectionManager | connection | The connection manager of the database you want to connect |
string | tableName | A name of an existing table in the database |
bool | readConstraints | If set to true, information about the Unique and Foreign Key constraints are also gathered. |
Returns
Type | Description |
---|---|
TableDefinition |
RemoveDuplicateColumns(TableDefinition)
Declaration
public static TableDefinition RemoveDuplicateColumns(TableDefinition definition)
Parameters
Type | Name | Description |
---|---|---|
TableDefinition | definition |
Returns
Type | Description |
---|---|
TableDefinition |