ConnectionConfig
struct ConnectionConfigConnection parameters for a libpq connection.
Build a Connection from this directly, or call to_conninfo() if you
want the raw libpq conninfo string for debugging or logging.
Implements Copyable, Movable
- Fields
host: Stringport: Intdbname: Stringuser: Stringpassword: Stringapplication_name: Stringsslmode: Stringconnect_timeout: Int
__init__
def __init__(out self, host: String = "localhost", port: Int = Int(5432), dbname: String = "", user: String = "", password: String = "", application_name: String = "postgres.mojo", sslmode: String = "prefer", connect_timeout: Int = Int(10)) set
def set(mut self, key: String, value: String) Escape hatch for any libpq conninfo keyword not exposed as a typed field above (e.g. target_session_attrs, options).
Setting a key that was already set — by an earlier set() call —
replaces its value in place rather than adding a duplicate, so
to_conninfo() stays deterministic and each keyword appears at
most once.
to_conninfo
def to_conninfo(self) -> String Render to a libpq conninfo string (key=value key=value ...).
Extra keys set via set() are emitted last, in the order they were
first set.