Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Functions PostgresProtocol.connect

1
2
3
4
5
6

Documentation

Public API (connecting)

Attempts to connect to the server at the given IP address.

The client will attempt to negotiate whether to use a TLS socket, or a TCP socket as per connectInfo.tlsMode.

The client will automatically attempt to use connectInfo.passwordfor authentication if challenged by the server. It will also automatically handle any supported authentication schemes.

Assertions

You can only call this function once per PostgresProtocolinstance, please reconstruct the instance if you'd like to attempt another connection.

Params

Throws

PostgresProtocolError.noValidSaslAlgorithmif a SASL-based authentication scheme was chosen, however none of the available schemes are supported by PostgresProcotol.

PostgresProtocolError.unsupportedAuthSchemeif no supported auth schemes are available.

PostgresProtocolError.noTlsif TLS is configured as required but the server refuses to negotiate a TLS session.

PostgresProtocolError.missingMessageif the server didn't send an Authentication message when expected.

PostgresProtocolError.bufferTooSmallif the buffer would exceed PostgresProtocolConfig.maxBufferSizewhen reading or writing.

PostgresProtocolError.unexpectedMessageif an unexpected message was returned by the server.

PostgresProtocolError.invalidMessageif a message returned by the server is in some way malformed.

PostgresProtocolError.notEnoughBytesif the server didn't send enough bytes than expected (more likely a Juptune parsing bug).

PostgresProtocolError.errorResponseif the server returned an ErrorResponse message.

Anything that TcpSocketand TlsSocketcan throw.

Returns

An errorful Resultif something went wrong.