-
Notifications
You must be signed in to change notification settings - Fork 874
Expand file tree
/
Copy pathTestDecodingData.cs
More file actions
39 lines (32 loc) · 1.14 KB
/
TestDecodingData.cs
File metadata and controls
39 lines (32 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using NpgsqlTypes;
using System;
namespace Npgsql.Replication.TestDecoding;
/// <summary>
/// Text representations of PostgreSQL WAL operations decoded by the "test_decoding" plugin. See
/// https://www.postgresql.org/docs/current/test-decoding.html.
/// </summary>
public sealed class TestDecodingData : ReplicationMessage
{
/// <summary>
/// Decoded text representation of the operation performed in this WAL entry
/// </summary>
public string Data { get; private set; } = default!;
internal TestDecodingData Populate(
NpgsqlLogSequenceNumber walStart, NpgsqlLogSequenceNumber walEnd, DateTime serverClock, string data)
{
base.Populate(walStart, walEnd, serverClock);
Data = data;
return this;
}
/// <inheritdoc />
public override string ToString() => Data;
/// <summary>
/// Returns a clone of this message, which can be accessed after other replication messages have been retrieved.
/// </summary>
public TestDecodingData Clone()
{
var clone = new TestDecodingData();
clone.Populate(WalStart, WalEnd, ServerClock, Data);
return clone;
}
}