ejabberd - Comments for "Database schema" https://www.ejabberd.im/node/1292 en On this forum https://www.ejabberd.im/node/1292#comment-2872 <div class="quote-msg"> <div class="quote-author"><em>asergey</em> wrote:</div> <p>Yes, I mentioned the Table Viewer in my original posting</p></div> <p>Sorry, I didn't read that part. Anyway, I'll re-use the minitutorial sometime on the future :)</p> <div class="quote-msg"> <div class="quote-author"><em>asergey</em> wrote:</div> <p>Oh, well, I'll try to extract the schema data the hard way. Is there a place on the site I can submit that document so that it can be evolved by the community?</p></div> <p>You can submit your text to the forums, and people may add comments. Then, you are free to modify your forum post and include those suggestions. Once you consider the text to be almost complete, it could be included on <noindex><a href="http://www.process-one.net/en/projects/ejabberd/docs/dev_en.html" rel="nofollow" >ejabberd Developers Guide</a></noindex>.</p> <p>BTW, the DB schema may vary on future ejabberd versions. So if ejabberd already exports a function that solves the requirement, it's preferable instead of writting Mnesia specific code.</p> Sun, 14 Jan 2007 21:23:55 +0000 mfoss comment 2872 at https://www.ejabberd.im Re: database schema https://www.ejabberd.im/node/1292#comment-2850 <div class="quote-msg"> <div class="quote-author"><em>badlop</em> wrote:</div> <p>I'm not aware of any public documentation. An alternative (or complement) to source code investigation is Erlang's Table Viewer. It is a graphical (Tk) interface to ETS and Mnesia tables. </p></div> <p>Yes, I mentioned the Table Viewer in my original posting (which is what I used to examine the tables). However, the table fields are composite, and tv tool can't show the nested elements of a record since records are tuples of arbitrary terms. For example:</p> <p>-record(passwd, {us, password}).</p> <p>Here 'us' is actually a composite field containing {Username, Server}. The way to figure it out is really by looking at the record definition in the *.hrl file hoping that it is defined more verbosely...</p> <p>At least when I write mnesia applications I tend to put all application-specific record definitions in a single file with description of a schema, which makes support much easier.</p> <p>Oh, well, I'll try to extract the schema data the hard way. Is there a place on the site I can submit that document so that it can be evolved by the community?</p> <p>Serge</p> Fri, 12 Jan 2007 13:10:04 +0000 asergey comment 2850 at https://www.ejabberd.im erlang's tv is handy for debugging https://www.ejabberd.im/node/1292#comment-2849 <p>I'm not aware of any public documentation. An alternative (or complement) to source code investigation is Erlang's Table Viewer. It is a graphical (Tk) interface to ETS and Mnesia tables.</p> <p>The easiest way to get TV working with ejabberd is:</p> <ol> <li>You must have ejabberd running on your machine, not on a remote one. </li><li>You must have full Erlang/OTP installed, including the graphical part, and the Tk graphical toolkit. </li><li>Start ejabberd on interactive mode, that means without -detached, so you get an Erlang console like this:<br /> <pre> Erlang (BEAM) emulator version 5.5.2 [source] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.5.2 (abort with ^G) (eja3@atenea)1&gt; ... =PROGRESS REPORT==== 12-Jan-2007::13:25:38 === application: ejabberd started_at: eja3@atenea</pre></li><li>Now start the Table Viewer typing: tv:start(). <pre>tv:start(). &lt;0.418.0&gt; (eja3@atenea)2&gt;</pre><p>And a window should appear called 'ETS tables on xx'.</p> </li><li>You can view ejabberd's ETS and Mnesia tables interactively, including their content. The GUI looks weird (due to Tk) and sometimes crashes if I maximize a window, but it does not interfere ejabberd normal operations, and is useful for debugging.<br /> </li></ol> Fri, 12 Jan 2007 12:49:26 +0000 mfoss comment 2849 at https://www.ejabberd.im