title: Best way to print out Mnesia table
body: <p>I tried this code snippet:</p>
  
  <pre><code>print_next(Current) -&gt;
      case mnesia:dirty_next(muppet, Current) of
          '$end_of_table' -&gt;
              io:format("~n", []),
              ok;
          Next -&gt;
              [Muppet] = mnesia:dirty_read({muppet, Next}),
              io:format("~p~n", [Muppet]),
              print_next(Next),
              ok
      end.
  
  print() -&gt;
      case mnesia:dirty_first(muppet) of
          '$end_of_table' -&gt;
              ok;
          First -&gt;
              [Muppet] = mnesia:dirty_read({muppet, First}),
              io:format("~p~n", [Muppet]),
              print_next(First),
              ok
      end.
  </code></pre>
  
  <p>But it is so long. Also I can use <code>dirty_all_keys</code> and then iterate through key list, but I want to know if there is a better way to print out Mnesia table contents.</p>