postgleam/config
Types
Connection configuration for PostgreSQL
pub type Config {
Config(
host: String,
port: Int,
database: String,
username: String,
password: String,
timeout: Int,
connect_timeout: Int,
extra_parameters: List(#(String, String)),
ssl: SslMode,
pgbouncer: Bool,
idle_interval: Int,
queue_timeout: Int,
)
}
Constructors
-
Config( host: String, port: Int, database: String, username: String, password: String, timeout: Int, connect_timeout: Int, extra_parameters: List(#(String, String)), ssl: SslMode, pgbouncer: Bool, idle_interval: Int, queue_timeout: Int, )
SSL connection mode
pub type SslMode {
SslDisabled
SslVerified
SslUnverified
}
Constructors
-
SslDisabledNo SSL (plain TCP)
-
SslVerifiedSSL required, verify server certificate (uses system CA store + SNI)
-
SslUnverifiedSSL required, skip certificate verification (for Neon, self-signed certs)
Values
pub fn extra_parameters(
config: Config,
params: List(#(String, String)),
) -> Config
Set extra startup parameters sent to PostgreSQL.
pub fn idle_interval(config: Config, ms: Int) -> Config
Set the health check interval in milliseconds (pool only). Idle connections are pinged at this interval. Default: 1000ms.
pub fn pgbouncer(config: Config, enabled: Bool) -> Config
Enable PgBouncer compatibility mode. Uses unnamed prepared statements with Flush to avoid mid-query backend reassignment in PgBouncer transaction pooling mode.