Module epgsql_cmd_batch

Execute multiple extended queries in a single network round-trip.

Behaviours: epgsql_command.

Description

Execute multiple extended queries in a single network round-trip

There are 2 kinds of interface:
  1. To execute multiple queries, each with it's own statement()
  2. To execute multiple queries, but by binding different parameters to the same statement()
  > {Bind
  <  BindComplete
  >  Execute
  <  DataRow*
  <  CommandComplete}*
  > Sync
  < ReadyForQuery

Data Types

arguments()

arguments() = {epgsql:statement(), [[epgsql:bind_param()]]} | [{epgsql:statement(), [epgsql:bind_param()]}]

response()

response() = [{ok, Count::non_neg_integer(), Rows::[tuple()]} | {ok, Count::non_neg_integer()} | {ok, Rows::[tuple()]} | {error, epgsql:query_error()}]

state()

state() = #batch{batch = [[epgsql:bind_param()]] | [{#statement{name = string(), columns = [#column{name = binary(), type = epgsql:epgsql_type(), oid = non_neg_integer(), size = -1 | pos_integer(), modifier = -1 | pos_integer(), format = integer(), table_oid = non_neg_integer(), table_attr_number = pos_integer()}], types = [epgsql:epgsql_type()], parameter_info = [epgsql_oid_db:oid_entry()]}, [epgsql:bind_param()]}], statement = #statement{name = string(), columns = [#column{name = binary(), type = epgsql:epgsql_type(), oid = non_neg_integer(), size = -1 | pos_integer(), modifier = -1 | pos_integer(), format = integer(), table_oid = non_neg_integer(), table_attr_number = pos_integer()}], types = [epgsql:epgsql_type()], parameter_info = [epgsql_oid_db:oid_entry()]} | undefined, decoder = epgsql_wire:row_decoder() | undefined}

Function Index

execute/2
handle_message/4
init/1

Function Details

execute/2

execute(Sock, Batch) -> any()

handle_message/4

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

init/1

init(Batch::arguments()) -> state()


Generated by EDoc