data PG::Config

Where and how to connect: what a URL or PG.connect's keywords say.

src/config.qz:2

Methods

def to_h -> Hash[Symbol, Object]

The fields as a Hash, by name.

src/config.qz:2

def with(*, host: String = …, port: Int = …, user: String = …, password: String? = …, database: String? = …, application_name: String? = …, allow_cleartext: Bool = …, connect_timeout: Duration? = …, max_scram_iterations: Int = …, statement_cache_size: Int = …, sslmode: Symbol = …, sslrootcert: String? = …) -> PG::Config

A copy with the fields given replaced.

src/config.qz:2

def host -> String

A host name or address, or a directory holding the server's unix socket (a path starting with /).

src/config.qz:5

def port -> Int

src/config.qz:6

def user -> String

src/config.qz:7

def password -> String?

src/config.qz:8

def database -> String?

nil: the user's name, as the server takes it.

src/config.qz:10

def application_name -> String?

src/config.qz:11

def allow_cleartext -> Bool

Whether a password may be sent in clear over TCP (always over a unix socket).

src/config.qz:14

def connect_timeout -> Duration?

How long connecting and authenticating may take (nil: no limit).

src/config.qz:16

def max_scram_iterations -> Int

The most SCRAM iterations the server may ask for (PG::Scram).

src/config.qz:18

def statement_cache_size -> Int

How many prepared statements PG::Connection#query keeps (0: none, as a pooler in transaction mode needs).

src/config.qz:21

def sslmode -> Symbol

Whether and how TLS is used over TCP: :disable, :allow, :prefer, :require, :verify_ca or :verify_full (PG.connect says what each does). A unix socket never uses TLS.

src/config.qz:25

def sslrootcert -> String?

The roots the server's certificate is verified against: a PEM file's path, or system for the system's store (nil: ~/.postgresql/root.crt when it exists; without roots, only :verify_ca and :verify_full fail, the others go unverified).

src/config.qz:30