Skip to content

Commit

Permalink
tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
JFriel committed Oct 22, 2024
1 parent 601ef24 commit 9de73e7
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,14 @@ public override void Execute()
{
redactionsToSaveTable = RegexRedactionHelper.GenerateRedactionsDataTable();
pksToSave = RegexRedactionHelper.GeneratePKDataTable();

var columnName = columnInfo.Name;
var table = columnInfo.TableInfo.Name;

_discoveredTable = columnInfo.TableInfo.Discover(DataAccessContext.InternalDataProcessing);
DiscoveredColumn[] discoveredColumns = _discoveredTable.DiscoverColumns();
_discoveredPKColumns = discoveredColumns.Where(c => c.IsPrimaryKey).ToArray();

if (_discoveredPKColumns.Length != 0)
{
_cataloguePKs = _catalogue.CatalogueItems.Where(c => c.ColumnInfo.IsPrimaryKey).ToList();
Expand All @@ -81,6 +84,7 @@ public override void Execute()
qb.TopX = (int)_readLimit;
}
var sql = qb.SQL;

var dt = new DataTable();
dt.BeginLoadData();
var conn = _server.GetConnection();
Expand All @@ -92,6 +96,7 @@ public override void Execute()
da.Fill(dt);
}
conn.Close();

redactionUpates = dt.Clone();
redactionUpates.BeginLoadData();
foreach (DataRow row in dt.Rows)
Expand Down Expand Up @@ -134,7 +139,6 @@ public override void Execute()
throw new Exception($"Unable to identify any primary keys in table '{table}'. Redactions cannot be performed on tables without primary keys");
}
resultCount += redactionUpates.Rows.Count;

}
}
}

0 comments on commit 9de73e7

Please sign in to comment.