Class PostgreSqlOptions
- Namespace
- Compendium.Adapters.PostgreSQL.Configuration
- Assembly
- Compendium.Adapters.PostgreSQL.dll
Configuration options for PostgreSQL event store.
public sealed class PostgreSqlOptions
- Inheritance
-
PostgreSqlOptions
- Inherited Members
Fields
SectionName
Configuration section name.
public const string SectionName = "Compendium:EventStore"
Field Value
Properties
AutoCreateSchema
Gets or sets whether to automatically create the schema.
public bool AutoCreateSchema { get; set; }
Property Value
BatchSize
Gets or sets the batch size for bulk operations.
public int BatchSize { get; set; }
Property Value
CommandTimeout
Gets or sets the command timeout in seconds. Increased to 60s to support bulk operations and high-load scenarios.
public int CommandTimeout { get; set; }
Property Value
ConnectionIdleLifetime
Gets or sets the connection idle lifetime in seconds. Idle connections are closed after this duration. Recommended: 900 (15 minutes).
public int ConnectionIdleLifetime { get; set; }
Property Value
ConnectionLifetime
Gets or sets the connection lifetime in seconds. Connections are recycled after this duration regardless of activity. Recommended: 3600 (1 hour) to prevent stale connections.
public int ConnectionLifetime { get; set; }
Property Value
ConnectionString
Gets or sets the PostgreSQL connection string.
public string ConnectionString { get; set; }
Property Value
ConnectionTimeout
Gets or sets the connection timeout in seconds. Time to wait for a connection from the pool. Recommended: 30 seconds.
public int ConnectionTimeout { get; set; }
Property Value
EnablePooling
Gets or sets whether to enable Npgsql connection pooling. Should always be true for production. Disable only for debugging.
public bool EnablePooling { get; set; }
Property Value
Keepalive
Gets or sets the TCP keepalive interval in seconds. Detects and closes broken connections. Recommended: 30 seconds. Set to 0 to disable.
public int Keepalive { get; set; }
Property Value
MaxPoolSize
Gets or sets the maximum application-level connection pool size. This uses a SemaphoreSlim to limit concurrent database operations. Recommended: 200 for high-load scenarios (1000+ concurrent operations). Note: This is separate from Npgsql's internal connection pooling.
public int MaxPoolSize { get; set; }
Property Value
MaximumPoolSize
Gets or sets the maximum Npgsql connection pool size. Must be less than PostgreSQL server's max_connections. Recommended: 200 for high-concurrency scenarios.
public int MaximumPoolSize { get; set; }
Property Value
MinimumPoolSize
Gets or sets the minimum Npgsql connection pool size. Pre-warms connections for immediate availability. Recommended: 50 for production workloads.
public int MinimumPoolSize { get; set; }
Property Value
TableName
Gets or sets the table name for event storage.
public string TableName { get; set; }