anchor.diff:           encode_flush/0,
            encode_sync/0]).
   
  --export_type([row_decoder/0, packet_type/0, packet_type/1]).
  +-export_type([row_decoder/0, packet_type/0]).
   
   -include("epgsql.hrl").
   -include("protocol.hrl").
   
   -opaque row_decoder() :: {[epgsql_binary:decoder()], [epgsql:column()], epgsql_binary:codec()}.
   -type packet_type() :: byte().                 % see protocol.hrl
  --type packet_type(Exact) :: Exact.
  +%% -type packet_type(Exact) :: Exact.   % TODO: uncomment when OTP-18 is dropped
   
   %% @doc tries to extract single postgresql packet from TCP stream
   -spec decode_message(binary()) -> {packet_type(), binary(), binary()} | binary().
  
positive.code: %%
  %% @param BinParams see {@link encode_parameters/2}.
  %% @param BinFormats  see {@link encode_formats/1}
  -spec encode_bind(iodata(), iodata(), iodata(), iodata()) -> {packet_type(?BIND), iodata()}.
  encode_bind(PortalName, StmtName, BinParams, BinFormats) ->
      {?BIND, [encode_string(PortalName), encode_string(StmtName), BinParams, BinFormats]}.
  
  
negative.code: %% Results in `ParseComplete' response.
  %%
  %% @param ColumnEncoding see {@link encode_types/2}
  -spec encode_parse(iodata(), iodata(), iodata()) -> {packet_type(), iodata()}.
  encode_parse(Name, SQL, ColumnEncoding) ->
      {?PARSE, [encode_string(Name), encode_string(SQL), ColumnEncoding]}.
  
  