Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In your source code you are only applying the gen_mod behaviour, if you do wish to have a gen_server you can do it in the same module, if you define the gen_server behaviour has well.</p> <p>A good example would be the ejabberd module <a href="http://svn.process-one.net/ejabberd-modules/mod_archive/trunk/src/mod_archive.erl" rel="nofollow">mod_archive</a>, which implements both behaviours.</p> <hr> <p>Edit: I never really worked "directly" with mysql on erlang. But through the ejabberd methods I find it pretty "easy"(you will have to make a few setup, but rather easy). You have the method </p> <pre><code>ejabberd_odbc:sql_query_t(Query) </code></pre> <p>And has an example you can find it on the module <a href="http://svn.process-one.net/ejabberd-modules/mod_archive/trunk/src/mod_archive_odbc.erl" rel="nofollow">mod_archive_odbc</a>.</p> <p>To use that method(and the last module) I haved downloaded the mysql native driver and put the beams created from the driver in ejabberd ebin dir (you can put it anywhere has long is on the erlang path). A a soft link to the ejabberd ebin is my favorite:</p> <pre><code>ln -s &lt;diryouhavethedriver&gt;/ebin/*.beam /usr/lib/ejabberd/ebin/ </code></pre> <p>and do a few configurations on you ejabberd.cfg. This process is described on <a href="https://support.process-one.net/doc/display/MESSENGER/Using+ejabberd+with+MySQL+native+driver" rel="nofollow">this page on process one</a>. Notice that the full steps are to make mysql the full database of ejabberd. You may not want that, so you must jump a few steps. Hope this help.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload