Class TableDefinition
A definition for a table in a database
Inheritance
TableDefinition
Namespace: ETLBox.ControlFlow
Assembly: ETLBox.dll
Syntax
public class TableDefinition
Constructors
TableDefinition()
Declaration
TableDefinition(string)
Declaration
public TableDefinition(string name)
Parameters
TableDefinition(string, List<TableColumn>)
Declaration
public TableDefinition(string name, List<TableColumn> columns)
Parameters
Properties
Columns
Declaration
public IList<TableColumn> Columns { get; set; }
Property Value
ForeignKeyConstraints
Declaration
public ICollection<ForeignKeyConstraint> ForeignKeyConstraints { get; set; }
Property Value
Name
Declaration
public string Name { get; set; }
Property Value
PrimaryKeyConstraintName
The constraint name for the primary key
Declaration
public string PrimaryKeyConstraintName { get; set; }
Property Value
UniqueKeyConstraints
Declaration
public ICollection<UniqueKeyConstraint> UniqueKeyConstraints { get; set; }
Property Value
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 |
FindColumn(string)
Declaration
public TableColumn FindColumn(string name)
Parameters
Returns
FromCLRType(ConnectionType, Type)
Declaration
public static TableDefinition FromCLRType(ConnectionType connectionType, Type clrType)
Parameters
Returns
FromCLRType(IConnectionManager, Type)
Declaration
public static TableDefinition FromCLRType(IConnectionManager connectionManager, Type clrType)
Parameters
Returns
FromCLRType<T>(IConnectionManager)
Declaration
public static TableDefinition FromCLRType<T>(IConnectionManager connectionManager)
Parameters
Returns
Type Parameters
FromProcedureName(IConnectionManager, string)
Declaration
public static TableDefinition FromProcedureName(IConnectionManager connection, string procedureName)
Parameters
Returns
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
RemoveDuplicateColumns(TableDefinition)
Declaration
public static TableDefinition RemoveDuplicateColumns(TableDefinition definition)
Parameters
Returns