Module epgsql_cmd_connect

Connects to the server and performs all the necessary handshakes.

Behaviours: epgsql_command.

Description

Connects to the server and performs all the necessary handshakes.

Special kind of command - it's exclusive: no other commands can run until this one finishes. It also uses some "private" epgsql_sock's APIs

Data Types

connect_error()

connect_error() = invalid_authorization_specification | invalid_password | {unsupported_auth_method, kerberosV5 | crypt | scm | gss | sspi | {unknown, integer()} | {sasl, [binary()]}} | {sasl_server_final, any()} | epgsql:query_error()

response()

response() = connected | {error, connect_error()}

Function Index

execute/2
handle_message/4
hide_password/1this function wraps plaintext password to a lambda function, so, if epgsql_sock process crashes when executing connect command, password will not appear in a crash log.
init/1
open_socket/2
opts_hide_password/1Replace password in Opts map with obfuscated one.

Function Details

execute/2

execute(PgSock, Connect) -> any()

handle_message/4

handle_message(X1, Message, Sock, State) -> any()

hide_password/1

hide_password(Password::iodata()) -> fun(() -> iodata())

this function wraps plaintext password to a lambda function, so, if epgsql_sock process crashes when executing connect command, password will not appear in a crash log

init/1

init(Opts) -> any()

open_socket/2

open_socket(SockOpts::[{atom(), any()}], ConnectOpts::epgsql:connect_opts()) -> {ok, gen_tcp | ssl, port() | ssl:sslsocket()} | {error, any()}

opts_hide_password/1

opts_hide_password(Opts) -> any()

Replace password in Opts map with obfuscated one


Generated by EDoc