data PG::Config
Where and how to connect: what a URL or PG.connect's keywords say.
Methods
def to_h -> Hash[Symbol, Object]
The fields as a Hash, by name.
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.
def host -> String
A host name or address, or a directory holding the server's unix
socket (a path starting with /).
def port -> Int
def user -> String
def password -> String?
def database -> String?
nil: the user's name, as the server takes it.
def application_name -> String?
def allow_cleartext -> Bool
Whether a password may be sent in clear over TCP (always over a unix socket).
def connect_timeout -> Duration?
How long connecting and authenticating may take (nil: no limit).
def max_scram_iterations -> Int
The most SCRAM iterations the server may ask for (PG::Scram).
def statement_cache_size -> Int
How many prepared statements PG::Connection#query keeps (0: none,
as a pooler in transaction mode needs).
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.
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).