Skip to content

Commit

Permalink
Removed unused DropUnderlyingTable methods from Postgres stores
Browse files Browse the repository at this point in the history
  • Loading branch information
stidsborg committed Sep 20, 2024
1 parent 285d362 commit 02d1c5a
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public override Task DeleteFailsWhenNonExpectedValueForExistingRegister()
private async Task<IRegister> CreateAndInitializeRegister([CallerMemberName] string memberName = "")
{
var underlyingRegister = new PostgresSqlUnderlyingRegister(Sql.ConnectionString, tablePrefix: memberName);
await underlyingRegister.DropUnderlyingTable();
await underlyingRegister.Initialize();
return new Register(underlyingRegister);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,7 @@ PRIMARY KEY (type, instance, position)
var command = new NpgsqlCommand(_initializeSql, conn);
await command.ExecuteNonQueryAsync();
}

private string? _dropUnderlyingTableSql;
public async Task DropUnderlyingTable()
{
await using var conn = await CreateConnection();
_dropUnderlyingTableSql ??= $"DROP TABLE IF EXISTS {_tablePrefix}_messages;";
var command = new NpgsqlCommand(_dropUnderlyingTableSql, conn);
await command.ExecuteNonQueryAsync();
}


private string? _truncateTableSql;
public async Task TruncateTable()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,4 @@ public async Task<IEnumerable<StoredTimeout>> GetTimeouts(FlowId flowId)

return storedMessages;
}

private string? _dropUnderlyingTableSql;
public async Task DropUnderlyingTable()
{
await using var conn = await CreateConnection();
_dropUnderlyingTableSql ??= $"DROP TABLE IF EXISTS {_tablePrefix}_timeouts;";
var command = new NpgsqlCommand(_dropUnderlyingTableSql, conn);
await command.ExecuteNonQueryAsync();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@ PRIMARY KEY (registertype, groupname, name)
await command.ExecuteNonQueryAsync();
}

private string? _dropUnderlyingTableSql;
public async Task DropUnderlyingTable()
{
await using var conn = new NpgsqlConnection(connectionString);
await conn.OpenAsync();

_dropUnderlyingTableSql ??= $"DROP TABLE IF EXISTS {tablePrefix}_register";
await using var command = new NpgsqlCommand(_dropUnderlyingTableSql, conn);
await command.ExecuteNonQueryAsync();
}

private string? _setIfEmptySql;
public async Task<bool> SetIfEmpty(RegisterType registerType, string group, string name, string value)
{
Expand Down

0 comments on commit 02d1c5a

Please sign in to comment.