Skip to content

Constraint Class ​

Definition ​

Specifies details of a database CONSTRAINT

  • Namespace: JASE.Database
  • Assembly: JASE.Database.dll

Constructors ​

NameDescription
Constraint()

Properties ​

NameDescription
ColumnCONSTRAINED column name
DetailCONSTRAINT details
ForeignKeyForeign Key details
IsDefaultConstraintReturns true if the constraint is detected as being a default column value
IsIndexBoolean indicating if constraint is implemented as an index
IsIndexUniqueBoolean indicating if constraint if implemented index is unique
TableName
TypeType of CONSTRAINT

Methods ​

NameDescription
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