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
TypeNameDescription
stringname
System.Collections.Generic.List<T><TableColumn>columns

TableDefinition(string)

Declaration
    public TableDefinition(string name)
Parameters
TypeNameDescription
stringname

Properties

Columns

The columns of the table

Declaration
    public IList<TableColumn> Columns { get; set; }
Property Value
TypeDescription
System.Collections.Generic.IList<T><TableColumn>

ForeignKeyConstraints

Declaration
    public ICollection<ForeignKeyConstraint> ForeignKeyConstraints { get; set; }
Property Value
TypeDescription
System.Collections.Generic.ICollection<T><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
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
TypeNameDescription
IConnectionManagerconnectionManager

The connection manager of the database you want to connect

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

RemoveDuplicateColumns(TableDefinition)

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