anchor.diff:  %%      DDL.  On success, 'ok' is returned, else an @{error, Reason@}
   %%      tuple.
   %%
  -%%      Note: Type validation is done on the first record only.  If
  -%%      any subsequent record contains fewer or more elements than
  -%%      there are columns, or some element fails to convert to the
  -%%      appropriate type, the rest of the records will not get
  -%%      inserted.
  +%%      put/3 uses the default encoding for communication with the
  +%%      server (set by riak_pb_socket:use_native_encoding/2)
  +
   put(Pid, TableName, Measurements) ->
       put(Pid, TableName, [], Measurements).
   
  --spec put(Pid::pid(), Table::table_name(), ColumnNames::[ts_columnname()], Data::[[ts_value()]]) ->
  +-spec put(Pid::pid(), Table::table_name(), [ts_columnname()] | [[ts_value()]], [[ts_value()]] | boolean()) ->
                    ok | {error, Reason::term()}.
   %% @doc Make data records from Data and insert them, individually,
   %%      into a time-series Table, using client Pid. Each record is a
  
positive.code: %%      first element, and a list of records, each represented as a
  %%      list of values, in the second element, or an @{error, Reason@}
  %%      tuple.
  query(Pid, QueryText) ->
      query(Pid, QueryText, []).
  
  -spec query(Pid::pid(), Query::string(), Interpolations::[{binary(), binary()}]) ->
                     {ColumnNames::[binary()], Rows::[tuple()]} | {error, term()}.
  %% @doc Execute a "SELECT ..." Query with client Pid, using
  %%      Interpolations.  The result returned is a tuple containing a
  %%      list of columns as binaries in the first element, and a list
  %%      of records, each represented as a list of values, in the
  %%      second element, or an @{error, Reason@} tuple.
  query(Pid, QueryText, Interpolations) ->
      Message = riakc_ts_query_operator:serialize(use_native_encoding(Pid), QueryText, Interpolations),
      Response = server_call(Pid, Message),
      riakc_ts_query_operator:deserialize(Response).
  
  query(Pid, QueryText, Interpolations, Cover) ->
      UseNativeEncoding = use_native_encoding(Pid),
      Message = riakc_ts_query_operator:serialize(UseNativeEncoding, QueryText, Interpolations),
      Response = get_query_response(UseNativeEncoding, Pid, Message, Cover),
      riakc_ts_query_operator:deserialize(Response).
  
  %% ------------------------------------------------------------
  %% Construct an appropriate request depending on encoding, and return
  %% the response
  %% ------------------------------------------------------------
  
  get_query_response(false, Pid, Message, Cover) ->
      server_call(Pid, Message#tsqueryreq{cover_context=Cover});
  get_query_response(true, Pid, Message, Cover) ->
      server_call(Pid, Message#tsttbqueryreq{cover_context=Cover}).
  
  %% @doc Generate a parallel coverage plan for the specified query
  get_coverage(Pid, Table, QueryText) ->
  
negative.code: -type ts_value() :: riak_pb_ts_codec:ldbvalue().
  -type ts_columnname() :: riak_pb_ts_codec:tscolumnname().
  
  %% Determine encoding type from Pid proplist stored in process dictionary
  
  use_native_encoding(Pid) ->
      use_native_encoding_from_proplist(get(Pid)).
  
  %% Extract the encoding type from a proplist
  
  use_native_encoding_from_proplist(undefined) ->
      false;
  