Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public class ExportInformations
Dictionary<string, string> _customTable = new Dictionary<string, string>();

List<string> _lstExcludeTables = null;

List<string> _lstExcludeRowsForTables = null;

/// <summary>
/// Gets or Sets the tables (black list) that will be excluded for export. The rows of the these tables will not be exported too.
/// </summary>
Expand All @@ -37,6 +38,23 @@ public List<string> ExcludeTables
}
}

/// <summary>
/// Gets or Sets the tables (black list) that will be excluded for row export.
/// </summary>
public List<string> ExcludeRowsForTables
{
get
{
if (_lstExcludeRowsForTables == null)
_lstExcludeRowsForTables = new List<string>();
return _lstExcludeRowsForTables;
}
set
{
_lstExcludeRowsForTables = value;
}
}

/// <summary>
/// Gets the list of document headers.
/// </summary>
Expand Down
16 changes: 15 additions & 1 deletion source code/MySqlBackup(MySqlConnector)/MySqlBackup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ void Export_TableRows()
if (ExportInfo.ExportTableStructure)
Export_TableStructure(tableName);

if (ExportInfo.ExportRows)
var excludeRows = Export_ThisRowForTableIsExcluded(tableName);
if (ExportInfo.ExportRows && !excludeRows)
Export_Rows(tableName, selectSQL);
}
}
Expand All @@ -400,6 +401,19 @@ bool Export_ThisTableIsExcluded(string tableName)
return false;
}

bool Export_ThisRowForTableIsExcluded(string tableName)
{
var tableNameLower = tableName.ToLower();

foreach (var blacklistedTable in ExportInfo.ExcludeRowsForTables)
{
if (blacklistedTable.ToLower() == tableNameLower)
return true;
}

return false;
}

void Export_TableStructure(string tableName)
{
if (stopProcess)
Expand Down