Skip to content

Commit 438cf21

Browse files
author
giordanol
committed
use ILKE. Replication slot name is forced to lcase
1 parent 86656ec commit 438cf21

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Blumchen/Subscriptions/Management/ReplicationSlotManagement.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ namespace Blumchen.Subscriptions.Management;
99
public static class ReplicationSlotManagement
1010
{
1111
#pragma warning disable CA2208
12+
private static Task<bool> ReplicationSlotExists(
13+
this NpgsqlDataSource dataSource,
14+
string slotName,
15+
CancellationToken ct
16+
) => dataSource.Exists("pg_replication_slots", "slot_name ILIKE $1", [slotName], ct);
17+
1218
public static async Task<CreateReplicationSlotResult> SetupReplicationSlot(
1319
this NpgsqlDataSource dataSource,
1420
LogicalReplicationConnection connection,
@@ -53,18 +59,12 @@ static async Task<CreateReplicationSlotResult> Create(
5359
}
5460
}
5561

56-
private static Task<bool> ReplicationSlotExists(
57-
this NpgsqlDataSource dataSource,
58-
string slotName,
59-
CancellationToken ct
60-
) => dataSource.Exists("pg_replication_slots", "slot_name = $1", [slotName], ct);
61-
6262
public record ReplicationSlotSetupOptions(
6363
string SlotName = $"{TableDescriptorBuilder.MessageTable.DefaultName}_slot",
6464
Subscription.CreateStyle CreateStyle = Subscription.CreateStyle.WhenNotExists,
65-
bool Binary = false //https://www.postgresql.org/docs/current/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-WITH-BINARY
65+
bool Binary =
66+
false //https://www.postgresql.org/docs/current/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-WITH-BINARY
6667
);
67-
6868
public abstract record CreateReplicationSlotResult
6969
{
7070
public record None: CreateReplicationSlotResult;

0 commit comments

Comments
 (0)