public DbTableConstraintColumn AddColumn(DbColumn cInfo, int seq = -1, bool non = false, int card = -1) { DbTableConstraintColumn c = constraintColumns.ContainsKey(cInfo.objectName) ? constraintColumns[cInfo.objectName] : constraintColumns.Add(cInfo.objectName, new DbTableConstraintColumn(this, cInfo)); c.seqInIndex = seq; c.nonUnique = non; c.cardinality = card; cInfo.constraints.Add(c); return(c); }
void GetAccessibleTables(TablePath path) { DbTable t = path == null ? table : path.referencedTable; foreach (DbTableConstraint constraint in t.constraints.Values) { if (constraint.isForeignKey || constraint.type == "inferred") { if (!paths.ContainsKey(constraint.referencedTable.objectName)) { if (constraint.referencedTable != table) { TablePath p = new TablePath(constraint, path); paths.Add(constraint.referencedTable.objectName, p); GetAccessibleTables(p); } } } } }
public int AliasUsed(string alias) { DbAlias a = aliases.ContainsKey(alias) ? aliases[alias] : null; if (a == null) { a = new DbAlias(alias, this); aliases.Add(alias, a); } int pos = a.Used(); aliases.SetPosition(alias, pos); return(pos); }
public DbTableConstraint GetOrAddConstraint(string nam, string typ) { return(constraints.ContainsKey(nam) ? constraints[nam] : constraints.Add(nam, new DbTableConstraint(nam, typ, this))); }
public string GetTableNameByAlias(string alias, string def = "") { return(tablesByAlias.ContainsKey(alias) ? tablesByAlias[alias].name : def); }