Module epgsql_command

Behaviour module for epgsql_sock commands.

This module defines the epgsql_command behaviour.
Required callback functions: init/1, execute/2, handle_message/4.

Description

Behaviour module for epgsql_sock commands.

Data Types

command()

command() = module()

execute_return()

execute_return() = {ok, epgsql_sock:pg_sock(), state()} | {send, epgsql_wire:packet_type(), PktData::iodata(), epgsql_sock:pg_sock(), state()} | {send_multi, [{epgsql_wire:packet_type(), PktData::iodata()}], epgsql_sock:pg_sock(), state()} | {stop, Reason::any(), Response::any(), epgsql_sock:pg_sock()}

handle_message_return()

handle_message_return() = {noaction, epgsql_sock:pg_sock()} | {noaction, epgsql_sock:pg_sock(), state()} | {add_result, Data::any(), Notification::any(), epgsql_sock:pg_sock(), state()} | {add_row, tuple(), epgsql_sock:pg_sock(), state()} | {finish, Result::any(), Notification::any(), epgsql_sock:pg_sock()} | {stop, Reason::any(), Response::any(), epgsql_sock:pg_sock()} | {requeue, epgsql_sock:pg_sock(), state()} | {sync_required, Why::any()} | unknown

state()

state() = any()

Function Index

execute/3
handle_message/5
init/2

Function Details

execute/3

execute(Command::command(), PgSock::epgsql_sock:pg_sock(), CmdState::state()) -> execute_return()

handle_message/5

handle_message(Command::command(), Type::byte(), Payload::binary() | epgsql:query_error(), PgSock::epgsql_sock:pg_sock(), State::state()) -> handle_message_return()

init/2

init(Command::command(), Args::any()) -> state()


Generated by EDoc