Skip to content

Commit f0982c9

Browse files
committed
Add SS_ prefix to DatabaseExporter test table names
- Add TableNamePrefix property to DatabaseExporter - Set SS_ prefix in ExportTests for consistent table naming
1 parent 9e03d40 commit f0982c9

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

Algo.Export/DatabaseExporter.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ public int BatchSize
6666
/// </summary>
6767
public bool DropExisting { get; set; }
6868

69+
/// <summary>
70+
/// Optional prefix for table names (e.g. "SS_").
71+
/// </summary>
72+
public string TableNamePrefix { get; set; }
73+
6974
/// <inheritdoc />
7075
protected override Task<(int, DateTime?)> ExportOrderLogAsync(IAsyncEnumerable<ExecutionMessage> messages, CancellationToken cancellationToken)
7176
=> DoAsync(messages, nameof(ExecutionMessage).Remove(nameof(Message)), GetExecutionColumns, ToExecutionDict, cancellationToken);
@@ -128,7 +133,7 @@ public int BatchSize
128133
var lastTime = default(DateTime?);
129134

130135
using var db = _dbProvider.CreateConnection(_connection);
131-
var table = _dbProvider.GetTable(db, tableName);
136+
var table = _dbProvider.GetTable(db, TableNamePrefix + tableName);
132137

133138
if (DropExisting)
134139
await table.DropAsync(cancellationToken);

Tests/ExportTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ async Task Do(string extension, Func<Stream, BaseExporter> create)
5353
})
5454
{
5555
DropExisting = true,
56+
TableNamePrefix = "SS_",
5657
};
5758
var (dbCount, dbLastTime) = await dbExporter.Export(arr.ToAsyncEnumerable(), token);
5859
validateResult(dbCount, dbLastTime, "DB");

0 commit comments

Comments
 (0)