internal MergeException(Database db, string conflictsTableName) : base("Merge failed.") { if (conflictsTableName != null) { IList <string> conflictTableList = new List <string>(); IList <int> conflictCountList = new List <int>(); using (View view = db.OpenView("SELECT `Table`, `NumRowMergeConflicts` FROM `" + conflictsTableName + "`")) { view.Execute(); foreach (Record rec in view) { using (rec) { conflictTableList.Add(rec.GetString(1)); conflictCountList.Add((int)rec.GetInteger(2)); } } } this.conflictTables = conflictTableList; this.conflictCounts = conflictCountList; } }
internal TableInfo(Database db, string name) { if (db == null) { throw new ArgumentNullException("db"); } if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentNullException("name"); } this.name = name; using (View columnsView = db.OpenView("SELECT * FROM `{0}`", name)) { this.columns = new ColumnCollection(columnsView); } this.primaryKeys = new ReadOnlyCollection<string>( TableInfo.GetTablePrimaryKeys(db, name)); }
internal TableInfo(Database db, string name) { if (db == null) { throw new ArgumentNullException("db"); } if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentNullException("name"); } this.name = name; using (View columnsView = db.OpenView("SELECT * FROM `{0}`", name)) { this.columns = new ColumnCollection(columnsView); } this.primaryKeys = new ReadOnlyCollection <string>( TableInfo.GetTablePrimaryKeys(db, name)); }
internal MergeException(Database db, string conflictsTableName) : base("Merge failed.") { if (conflictsTableName != null) { IList<string> conflictTableList = new List<string>(); IList<int> conflictCountList = new List<int>(); using (View view = db.OpenView("SELECT `Table`, `NumRowMergeConflicts` FROM `" + conflictsTableName + "`")) { view.Execute(); foreach (Record rec in view) using (rec) { conflictTableList.Add(rec.GetString(1)); conflictCountList.Add((int) rec.GetInteger(2)); } } this.conflictTables = conflictTableList; this.conflictCounts = conflictCountList; } }