anchor.diff:      'string'.
   
   init_meta_entry(Model) when is_binary(Model)->
  -	ddb:put(Model, [{<<"id">>, <<"metadata">>, 'string'},
  -					{<<"counter">>, <<"0">>, 'number'}]).
  +    ModelAtom = binary_to_atom(Model, latin1),
  +    Attributes = ModelAtom:module_info(attributes),
  +    case proplists:get_value(primary_key, Attributes) of
  +        undefined ->
  +            ddb:put(Model, [{<<"id">>, <<"__metadata">>, 'string'},
  +                            {<<"__counter">>, <<"0">>, 'number'}]);
  +        [Field] ->
  +            FieldBin = atom_to_binary(Field, latin1),
  +            ddb:put(Model, [{FieldBin, <<"__metadata">>, 'string'},
  +                            {<<"__counter">>, <<"0">>, 'number'}])
  +    end.
   
   %%
   %% Helper functions for creating records
  
positive.code: get_new_unique_id(Model) when is_atom(Model) ->
  	get_new_unique_id(erlang:atom_to_binary(Model, latin1));
  get_new_unique_id(Model) when is_binary(Model) ->
  	{ok, Ret} = ddb:get(Model, ddb:key_value(<<"metadata">>, 'string')),
  	case proplists:get_value(<<"Item">>, Ret) of
  		undefined ->
  			init_meta_entry(Model),
  			get_new_unique_id(Model);
  		Attrs ->
  			[{<<"N">>, CounterBin}] = proplists:get_value(<<"counter">>, Attrs),
  			Counter = list_to_term(binary_to_list(CounterBin)),
  			Id = Counter + 1,
  			ddb:update(Model, ddb:key_value(<<"metadata">>, 'string'), [{<<"counter">>, list_to_binary(io_lib:format("~p", [Id])), 'number', 'put'}]),
  			lists:flatten(io_lib:format("~p-~p", [binary_to_atom(Model, latin1), Id]))
  	end.
  
  
negative.code: 	Attrs = SavedRec:attributes(),
  	%% WEIRD: dynamodb does not allow empty strings as values, don't store them.
  	Fields = [ {atom_to_binary(K,latin1), val_to_binary(V), type_of(V)} || {K, V} <- Attrs, not_empty(V) ],
  	ddb:put(atom_to_binary(Model, latin1), Fields),
      {ok, SavedRec}.
  
  update_existing(Record) ->
  	Model  = element(1, Record),
  