24 namespace Deveel.Data.Sql.Statements {
28 : this(null, constraintType, columns) {
32 ConstraintName = constraintName;
40 Columns = data.
GetValue<
string[]>(
"Columns");
43 ReferenceColumns = data.
GetValue<
string[]>(
"ReferenceColumns");
48 public string ConstraintName {
get;
private set; }
52 public string[] Columns {
get;
private set; }
58 public string[] ReferenceColumns {
get; set; }
65 var checkExpression = CheckExpression;
66 if (checkExpression != null)
67 checkExpression = checkExpression.Prepare(preparer);
70 CheckExpression = checkExpression,
72 ReferenceColumns = ReferenceColumns
86 CheckExpression = expression
94 ReferenceColumns = refcolumns,
101 throw new NotImplementedException();
105 throw new NotImplementedException();
109 data.
SetValue(
"Name", ConstraintName);
113 data.
SetValue(
"ReferenceColumns", ReferenceColumns);
114 data.
SetValue(
"Check", CheckExpression);
115 data.
SetValue(
"OnDelete", (
int)OnDelete);
116 data.
SetValue(
"OnUpdate", (
int)OnUpdate);
void GetData(SerializeData data)
SqlTableConstraint(string constraintName, ConstraintType constraintType, string[] columns)
void SetValue(string key, Type type, object value)
static SqlTableConstraint Deserialize(BinaryReader reader)
static SqlTableConstraint PrimaryKey(string constraintName, string[] columns)
static void Serialize(SqlTableConstraint constraint, BinaryWriter writer)
ForeignKeyAction
Enumerates the foreign key referential trigger actions.
ConstraintType
An enumeration of all the supported kinds of constraints within a table or a schema.
static SqlTableConstraint UniqueKey(string constraintName, string[] columns)
An interface used to prepare a SqlExpression object.
SqlTableConstraint(ObjectData data)
SqlTableConstraint(ConstraintType constraintType, string[] columns)
object Prepare(IExpressionPreparer preparer)
Converts the underlying value of this instance into an object that can be evaluated by an expression...
static SqlTableConstraint Check(string constraintName, SqlExpression expression)
object GetValue(string key)
Defines the base class for instances that represent SQL expression tree nodes.
static SqlTableConstraint ForeignKey(string constraintName, string[] columns, string refTable, string[] refcolumns, ForeignKeyAction onDelete, ForeignKeyAction onUpdate)
A contract for objects that participate to a SqlExpression.Prepare phase of an expression evaluation...
string GetString(string key)