/
dev-npgsql
/
npgsql
Обзор
Документация
Войти
/
dev-npgsql
/
npgsql
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
v8.0.5
src/Npgsql/Replication/ReplicationSlotOptions.cs
59 строк
2 KB
Shay Rojansky
Use file-scoped namespaces (#4225)
18 дек 2021, 13:52
Не верифицирован
18 дек 2021, 13:52
43756d1
Код
Авторство
О чём код?
using System; using NpgsqlTypes; namespace Npgsql.Replication; /// <summary> /// Contains information about a replication slot. /// </summary> public readonly struct ReplicationSlotOptions { /// <summary> /// Creates a new <see cref="ReplicationSlotOptions"/> instance. /// </summary> /// <param name="slotName"> /// The name of the replication slot. /// </param> /// <param name="consistentPoint"> /// The WAL location at which the slot became consistent. /// </param> public ReplicationSlotOptions(string slotName, string? consistentPoint = null) : this(slotName, consistentPoint is null ? default : NpgsqlLogSequenceNumber.Parse(consistentPoint), null){} /// <summary> /// Creates a new <see cref="ReplicationSlotOptions"/> instance. /// </summary> /// <param name="slotName"> /// The name of the replication slot. /// </param> /// <param name="consistentPoint"> /// The WAL location at which the slot became consistent. /// </param> public ReplicationSlotOptions(string slotName, NpgsqlLogSequenceNumber consistentPoint) : this(slotName, consistentPoint, null) {} internal ReplicationSlotOptions( string slotName, NpgsqlLogSequenceNumber consistentPoint, string? snapshotName) { SlotName = slotName ?? throw new ArgumentNullException(nameof(slotName), "The replication slot name cannot be null."); ConsistentPoint = consistentPoint; SnapshotName = snapshotName; } /// <summary> /// The name of the replication slot. /// </summary> public string SlotName { get; } /// <summary> /// The WAL location at which the slot became consistent. /// </summary> public NpgsqlLogSequenceNumber ConsistentPoint { get; } /// <summary> /// The identifier of the snapshot exported by the CREATE_REPLICATION_SLOT command. /// </summary> internal string? SnapshotName { get; } }