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
Type | Name | Description |
---|---|---|
System.String | name |
TableDefinition(String, List<TableColumn>)
Declaration
public TableDefinition(string name, List<TableColumn> columns)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
System.Collections.Generic.List<TableColumn> | columns |
Properties
Columns
The columns of the table
Declaration
public IList<TableColumn> Columns { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<TableColumn> |
ForeignKeyConstraints
Declaration
public ICollection<ForeignKeyConstraint> ForeignKeyConstraints { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<ForeignKeyConstraint> |
Name
The name of the table
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
PrimaryKeyConstraintName
The constraint name for the primary key
Declaration
public string PrimaryKeyConstraintName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
UniqueKeyConstraints
Declaration
public ICollection<UniqueKeyConstraint> UniqueKeyConstraints { get; set; }
Property Value
Type | Description |
---|---|
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
Type | Name | Description |
---|---|---|
IConnectionManager | connectionManager | 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
Type | Name | Description |
---|---|---|
IConnectionManager | connection | The connection manager of the database you want to connect |
System.String | tableName | A name of an existing table in the database |
System.Boolean | readConstraints | If set to true, information about the Unique and Foreign Key constraints are also gathered. |
Returns
Type | Description |
---|---|
TableDefinition |
TryRemoveTrailingSingleQuotes(String)
Declaration
protected static string TryRemoveTrailingSingleQuotes(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value |
Returns
Type | Description |
---|---|
System.String |