using System;
using Svrnty.CQRS.Events.PostgreSQL.Configuration;
namespace Svrnty.CQRS.Events.PostgreSQL.Configuration;
///
/// Configuration options for PostgreSQL event stream storage.
///
public sealed class PostgresEventStreamStoreOptions
{
///
/// PostgreSQL connection string.
///
///
/// Example: "Host=localhost;Database=mydb;Username=myuser;Password=mypass"
///
public required string ConnectionString { get; set; }
///
/// Schema name for event streaming tables.
///
///
/// Defaults to "event_streaming". Allows isolation of event tables from application tables.
///
public string SchemaName { get; set; } = "event_streaming";
///
/// Table name for persistent events.
///
///
/// Defaults to "events". Used for append-only event log storage.
///
public string EventsTableName { get; set; } = "events";
///
/// Table name for ephemeral queue events.
///
///
/// Defaults to "queue_events". Used for message queue semantics.
///
public string QueueEventsTableName { get; set; } = "queue_events";
///
/// Table name for consumer offsets.
///
///
/// Defaults to "consumer_offsets". Tracks consumer position in persistent streams.
///
public string OffsetsTableName { get; set; } = "consumer_offsets";
///
/// Maximum number of connections in the connection pool.
///
///
/// Defaults to 100. Adjust based on your application's concurrency needs.
///
public int MaxPoolSize { get; set; } = 100;
///
/// Minimum number of connections in the connection pool.
///
///
/// Defaults to 0. Connections are created on demand.
///
public int MinPoolSize { get; set; } = 0;
///
/// Command timeout in seconds.
///
///
/// Defaults to 30 seconds. Increase for operations on very large streams.
///
public int CommandTimeout { get; set; } = 30;
///
/// Enable automatic schema creation and migration.
///
///
/// Defaults to true for development. Set to false in production and use migration scripts.
///
public bool AutoMigrate { get; set; } = true;
///
/// Enable table partitioning for the events table.
///
///
/// Defaults to false. When enabled, creates monthly partitions for better performance on large datasets.
/// Requires PostgreSQL 10+.
///
public bool EnablePartitioning { get; set; } = false;
///
/// Batch size for reading events from persistent streams.
///
///
/// Defaults to 1000. Maximum number of events returned per ReadStreamAsync call.
///
public int ReadBatchSize { get; set; } = 1000;
}