Class TableDefinition

A definition for a table in a database

Inheritance
System.Object
TableDefinition
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ETLBox.ControlFlow
Assembly: ETLBox.dll
Syntax
    public class TableDefinition

Constructors

TableDefinition()

Declaration
    public TableDefinition()

TableDefinition(String)

Declaration
    public TableDefinition(string name)
Parameters
TypeNameDescription
System.Stringname

TableDefinition(String, List<TableColumn>)

Declaration
    public TableDefinition(string name, List<TableColumn> columns)
Parameters
TypeNameDescription
System.Stringname
System.Collections.Generic.List<TableColumn>columns

Properties

Columns

The columns of the table

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

ForeignKeyConstraints

Declaration
    public ICollection<ForeignKeyConstraint> ForeignKeyConstraints { get; set; }
Property Value
TypeDescription
System.Collections.Generic.ICollection<ForeignKeyConstraint>

Name

The name of the table

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

PrimaryKeyConstraintName

The constraint name for the primary key

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

UniqueKeyConstraints

Declaration
    public ICollection<UniqueKeyConstraint> UniqueKeyConstraints { get; set; }
Property Value
TypeDescription
System.Collections.Generic.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

FromTableName(IConnectionManager, String, Boolean)

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

System.StringtableName

A name of an existing table in the database

System.BooleanreadConstraints

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

Returns
TypeDescription
TableDefinition

TryRemoveTrailingSingleQuotes(String)

Declaration
    protected static string TryRemoveTrailingSingleQuotes(string value)
Parameters
TypeNameDescription
System.Stringvalue
Returns
TypeDescription
System.String