anchor.diff:  %% node ops
   %%
   
  --spec create_node(#chef_node{}) -> {ok, 1} | {error, term()}.
  -create_node(#chef_node{}=Node) ->
  -    create_object(Node).
  -
  --spec delete_node(bin_or_string()) -> {ok, 1 | 'none' | 'not_found'} | {error, term()}.
  -delete_node(NodeId) when is_list(NodeId) ->
  -    delete_node(list_to_binary(NodeId));
  -delete_node(#chef_node{id=NodeId})->
  -    delete_node(NodeId);
  -delete_node(NodeId) when is_binary(NodeId) ->
  -    delete_object(delete_node_by_id, NodeId).
  -
  --spec update_node(#chef_node{}) -> {ok, 1 | not_found} | {error, term()}.
  -update_node(#chef_node{environment = Environment,
  -                       last_updated_by = LastUpdatedBy,
  -                       updated_at = UpdatedAt,
  -                       serialized_object = Object,
  -                       id = Id}) ->
  -    UpdateFields = [Environment, LastUpdatedBy, UpdatedAt, Object, Id],
  -    do_update(update_node_by_id, UpdateFields).
  -
   -spec bulk_get_nodes([binary()]) -> {ok, [binary()] | not_found} |
                                       {error, term()}.
   bulk_get_nodes(Ids) ->
  
positive.code: bulk_get_roles(Ids) ->
      bulk_get_objects(role, Ids).
  
  -spec create_role(#chef_role{}) -> {ok, 1} | {error, term()}.
  create_role(#chef_role{}=Role) ->
      create_object(Role).
  
  -spec delete_role(bin_or_string()) -> {ok, 1 | 'none' | 'not_found'} | {error, term()}.
  delete_role(RoleId) when is_list(RoleId) ->
      delete_role(list_to_binary(RoleId));
  delete_role(#chef_role{id=RoleId})->
      delete_role(RoleId);
  delete_role(RoleId) when is_binary(RoleId) ->
      delete_object(delete_role_by_id, RoleId).
  
  -spec update_role(#chef_role{}) -> {ok, 1 | not_found} | {error, term()}.
  update_role(#chef_role{last_updated_by = LastUpdatedBy,
                         updated_at = UpdatedAt,
                         serialized_object = Object,
                         id = Id}) ->
      UpdateFields = [LastUpdatedBy, UpdatedAt, Object, Id],
      do_update(update_role_by_id, UpdateFields).
  
  %%
  %% data_bag_item ops
  %%
  
  -spec fetch_data_bag_items(bin_or_string(), bin_or_string()) ->
                                    {ok, [binary()]} | {error, term()}.
  %% @doc Return list of data_bag_item names for a given organization
  fetch_data_bag_items(OrgId, DataBagName) ->
      RecordName = chef_data_bag_item,
      QueryName = list_query_for(RecordName),
      case sqerl:select(QueryName, [OrgId, DataBagName], rows_as_scalars, [item_name]) of
          {ok, L} when is_list(L) ->
              {ok, L};
          {ok, none} ->
              {ok, []};
          {error, Error} ->
              {error, Error}
      end.
  
  -spec fetch_data_bag_item_ids(bin_or_string(), bin_or_string()) ->
                                       {ok, [binary()]} | {error, term()}.
  
negative.code:                                            {error, term()}.
  bulk_get_environments(Ids) ->
      bulk_get_objects(environment, Ids).
  
  %%
  %% client ops
  