public static void AddConstraint(this IQuery query, ObjectName tableName, ConstraintInfo constraintInfo) { if (constraintInfo.ConstraintType == ConstraintType.PrimaryKey) { var columnNames = constraintInfo.ColumnNames; if (columnNames.Length > 1) throw new ArgumentException(); query.AddPrimaryKey(tableName, columnNames[0], constraintInfo.ConstraintName); } else if (constraintInfo.ConstraintType == ConstraintType.Unique) { query.AddUniqueKey(tableName, constraintInfo.ColumnNames, constraintInfo.ConstraintName); } else if (constraintInfo.ConstraintType == ConstraintType.Check) { query.AddCheck(tableName, constraintInfo.CheckExpression, constraintInfo.ConstraintName); } else if (constraintInfo.ConstraintType == ConstraintType.ForeignKey) { query.AddForeignKey(tableName, constraintInfo.ColumnNames, constraintInfo.ForeignTable, constraintInfo.ForeignColumnNames, constraintInfo.OnDelete, constraintInfo.OnUpdate, constraintInfo.ConstraintName); } }
public static CommandGroupBuilder UseGlobalWhitelist(this CommandGroupBuilder builder) { builder.AddCheck(new WhitelistChecker(builder.Service.Client)); return builder; }
public static CommandBuilder PrivateOnly(this CommandBuilder builder) { builder.AddCheck(new PrivateChecker()); return builder; }
public static CommandGroupBuilder MinPermissions(this CommandGroupBuilder builder, int minPermissions) { builder.AddCheck(new PermissionLevelChecker(builder.Service.Client, minPermissions)); return builder; }
public static CommandGroupBuilder MinDynPermissions(this CommandGroupBuilder builder, int deafultPerms) { builder.AddCheck(new DynamicPermissionChecker(builder.Service.Client, deafultPerms)); return builder; }
public static CommandBuilder UseGlobalBlacklist(this CommandBuilder builder) { builder.AddCheck(new BlacklistChecker(builder.Service.Client)); return builder; }
public static CommandGroupBuilder PublicOnly(this CommandGroupBuilder builder) { builder.AddCheck(new PublicChecker()); return builder; }