struct PQ::ConnInfo
- PQ::ConnInfo
- Struct
- Value
- Object
Defined in:
pq/conninfo.crConstant Summary
-
SOCKET_SEARCH =
["/run/postgresql/.s.PGSQL.5432", "/tmp/.s.PGSQL.5432", "/var/run/postgresql/.s.PGSQL.5432"] of ::String
-
SUPPORTED_AUTH_METHODS =
["cleartext", "md5", "scram-sha-256", "scram-sha-256-plus"] of ::String
Constructors
-
.new(host : String | Nil = nil, database : String | Nil = nil, user : String | Nil = nil, password : String | Nil = nil, port : Int | String | Nil = 5432, sslmode : String | Symbol | Nil = nil)
Create a new ConnInfo from all parts
-
.new(uri : URI)
Initializes with a
URI
-
.new(params : Hash)
Initialize with a
Hash
Class Method Summary
-
.from_conninfo_string(conninfo : String)
Initialize with either "postgres://" urls or postgres "key=value" pairs
Instance Method Summary
- #auth_methods : Array(String)
-
#database : String
The database name.
-
#host : String
The host.
-
#password : String | Nil
The password.
-
#port : Int32
The port, defaults to 5432.
-
#sslcert : String | Nil
The sslcert.
-
#sslkey : String | Nil
The sslkey.
-
#sslmode : Symbol
The sslmode.
-
#sslrootcert : String | Nil
The sslrootcert.
-
#user : String
The user.
Constructor Detail
def self.new(host : String | Nil = nil, database : String | Nil = nil, user : String | Nil = nil, password : String | Nil = nil, port : Int | String | Nil = 5432, sslmode : String | Symbol | Nil = nil)
#
Create a new ConnInfo from all parts
def self.new(params : Hash)
#
Initialize with a Hash
Valid keys match Postgres "conninfo" keys and are "host"
, "dbname"
,
"user"
, "password"
, "port"
, "sslmode"
, "sslcert"
, "sslkey"
and "sslrootcert"
Class Method Detail
def self.from_conninfo_string(conninfo : String)
#
Initialize with either "postgres://" urls or postgres "key=value" pairs