<br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">I've read[1] that mnesia doesn't support composite keys. It seems I can use<br>
keys made up of tuples though:<br><br>
(emacs@gram)11> mnesia:create_table(test, [{attributes, [id, data]}]).<br>
{atomic,ok}<br>
(emacs@gram)19> Ins = fun() -> mnesia:write({test, {a_key, 0}, "asdfasdf"})<br>
end.<br>
#Fun<erl_eval.20.67289768><br>
(emacs@gram)20> mnesia:transaction(Ins).<br>
{atomic,ok}<br>
(emacs@gram)21> R = fun() -> mnesia:read(test, {a_key, 0}) end.<br>
#Fun<erl_eval.20.67289768><br>
(emacs@gram)22> mnesia:transaction(R).<br>
{atomic,[{test,{a_key,0},"<div id=":4f" class="ArwC7c ckChnd">asdfasdf"}]}<br>
<br>
<br>
Is tuples as keys common practice or A Really Bad Idea(tm)?</div></blockquote>
<br>Tuple keys can actually be a Really Good Idea, especially with ordered_set tables.<br><br>Jacob<br>