Appearance
Constraint Class
Definition
Specifies details of a database CONSTRAINT
- Namespace:
JASE.Database - Assembly:
JASE.Database.dll
Constructors
| Name | Description |
|---|---|
Constraint() |
Properties
| Name | Description |
|---|---|
Column | CONSTRAINED column name |
Detail | CONSTRAINT details |
ForeignKey | Foreign Key details |
IsDefaultConstraint | Returns true if the constraint is detected as being a default column value |
IsIndex | Boolean indicating if constraint is implemented as an index |
IsIndexUnique | Boolean indicating if constraint if implemented index is unique |
TableName | |
Type | Type of CONSTRAINT |
Methods
| Name | Description |
|---|---|
Constraint CreateForeignKey(string constrainedTable, string constrainedSchema, IForeignKey foreignKey) | Creates a FOREIGN KEY constraint for the given table using foreignKey. |
Task<bool> Drop(IDatabaseSession connection) | Drop the Constraint from the database |
string DropSql(IDatabaseSession connection) | Returns Sql for DROPing the Constraint |
string DropSql(ISqlGenerator generator) | Returns Sql for DROPing the Constraint |
string GetSchemaAndName(IDatabaseSession connection) | Returns table schema and table name formatted based on the connections delimiters |
bool SetColumnName(string column) | Set a new name for the Constraints Column |
string Sql(ISqlGenerator generator) | Generates an SQL statement to create a new copy of the Constraint |