public static void AddAutoColumns(Table table, SqlType[] colTypes) { for (int i = 0; i < colTypes.Length; i++) { ColumnSchema column = new ColumnSchema(QNameManager.GetAutoColumnName(i), colTypes[i], true, false, null); table.AddColumnNoCheck(column); } }
public static Table NewLookupTable(Database database) { Table table; QNameManager.QName subqueryTableName = database.NameManager.GetSubqueryTableName(); ColumnSchema column = new ColumnSchema(QNameManager.GetAutoColumnName(0), SqlType.SqlInteger, false, true, null); TableDerived derived1 = new TableDerived(database, subqueryTableName, 2, null, null); derived1.AddColumn(column); TableDerived derived2 = table = derived1; QNameManager.QName name = derived2.GetName(); int[] columns = new int[1]; table.CreatePrimaryKeyConstraint(name, columns, true); return(derived2); }