TableDefinition

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
    public TableDefinition()

TableDefinition(string)

Declaration
    public TableDefinition(string name)
Parameters
TypeNameDescription
stringname

TableDefinition(string, List<TableColumn>)

Declaration
    public TableDefinition(string name, List<TableColumn> columns)
Parameters
TypeNameDescription
stringname
List<TableColumn>columns

Properties

Columns

The columns of the table

Declaration
    public IList<TableColumn> Columns { get; set; }
Property Value
TypeDescription
IList<TableColumn>

ForeignKeyConstraints

Declaration
    public ICollection<ForeignKeyConstraint> ForeignKeyConstraints { get; set; }
Property Value
TypeDescription
ICollection<ForeignKeyConstraint>

Name

The name of the table

Declaration
    public string Name { get; set; }
Property Value
TypeDescription
string

PrimaryKeyConstraintName

The constraint name for the primary key

Declaration
    public string PrimaryKeyConstraintName { get; set; }
Property Value
TypeDescription
string

UniqueKeyConstraints

Declaration
    public ICollection<UniqueKeyConstraint> UniqueKeyConstraints { get; set; }
Property Value
TypeDescription
ICollection<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
TypeNameDescription
IConnectionManagerconnectionManager

The connection manager of the database you want to connect

FindColumn(string)

Declaration
    public TableColumn FindColumn(string name)
Parameters
TypeNameDescription
stringname
Returns
TypeDescription
TableColumn

FromCLRType(ConnectionType, Type)

Declaration
    public static TableDefinition FromCLRType(ConnectionType connectionType, Type clrType)
Parameters
TypeNameDescription
ConnectionTypeconnectionType
TypeclrType
Returns
TypeDescription
TableDefinition

FromCLRType(IConnectionManager, Type)

Declaration
    public static TableDefinition FromCLRType(IConnectionManager connectionManager, Type clrType)
Parameters
TypeNameDescription
IConnectionManagerconnectionManager
TypeclrType
Returns
TypeDescription
TableDefinition

FromCLRType<T>(IConnectionManager)

Declaration
    public static TableDefinition FromCLRType<T>(IConnectionManager connectionManager)
Parameters
TypeNameDescription
IConnectionManagerconnectionManager
Returns
TypeDescription
TableDefinition
Type Parameters
NameDescription
T

FromProcedureName(IConnectionManager, string)

Declaration
    public static TableDefinition FromProcedureName(IConnectionManager connection, string procedureName)
Parameters
TypeNameDescription
IConnectionManagerconnection
stringprocedureName
Returns
TypeDescription
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
TypeNameDescription
IConnectionManagerconnection

The connection manager of the database you want to connect

stringtableName

A name of an existing table in the database

boolreadConstraints

If set to true, information about the Unique and Foreign Key constraints are also gathered.

Returns
TypeDescription
TableDefinition

GetSchema(IConnectionManager, string)

Declaration
    public static TableDefinition GetSchema(IConnectionManager connection, string tableName)
Parameters
TypeNameDescription
IConnectionManagerconnection
stringtableName
Returns
TypeDescription
TableDefinition

RemoveDuplicateColumns(TableDefinition)

Declaration
    public static TableDefinition RemoveDuplicateColumns(TableDefinition definition)
Parameters
TypeNameDescription
TableDefinitiondefinition
Returns
TypeDescription
TableDefinition