https://wiki.anope.org/index.php?title=2.0/Modules/m_sql&feed=atom&action=history2.0/Modules/m sql - Revision history2024-03-28T19:09:36ZRevision history for this page on the wikiMediaWiki 1.23.4//wiki.anope.org/index.php?title=2.0/Modules/m_sql&diff=1012&oldid=prevAzander: Created page with "{{Language|2.0/Modules/m_sql}} {{Header|m_sql & m_sql_live|Database|Anope}} == <div class="moduleheader">Description</div> == This modules allows you to store all of nick..."2014-05-30T19:36:14Z<p>Created page with "{{Language|2.0/Modules/m_sql}} {{Header|m_sql & m_sql_live|Database|Anope}} == <div class="moduleheader">Description</div> == This modules allows you to store all of nick..."</p>
<p><b>New page</b></p><div>{{Language|2.0/Modules/m_sql}}<br />
{{Header|m_sql &amp; m_sql_live|Database|Anope}}<br />
<br />
== <div class="moduleheader">Description</div> ==<br />
This modules allows you to store all of nickserv, chanserv, memoserv, and operserv's data in a mysql database.<br />
<br />
If you use '''m_sql_live''' it reads and writes the database in real time.<br />
<br />
<br />
*'''NOTE''': Requres a SQL backend module to be present and properly configured. <br />
<br />
;name= :Name of this module<br />
<br />
;engine= :Database engine to use<br />
<br />
;prefix= :table prefix to pre-append to table names<br />
<br />
;import= :Flag to tell it to import data from other data sources, can only be used with m_sql and '''not''' with m_sql_live (see nots in configuration)<br />
<br />
== <div class="moduleheader">Schema</div> ==<br />
See [[2.0/Mysql:Scheme|Mysql:Scheme]] for details.<br />
<br />
<br />
<br />
== <div class="moduleheader">Default Configuration</div> ==<br />
<br />
<div class="code"><br />
<syntaxhighlight lang="cpp"><br />
/*<br />
* db_sql and db_sql_live<br />
*<br />
* db_sql module allows saving and loading databases using one of the SQL engines.<br />
* This module loads the databases once on startup, then incrementally updates<br />
* objects in the database as they are changed within Anope in real time. Changes<br />
* to the SQL tables not done by Anope will have no effect and will be overwritten.<br />
*<br />
* db_sql_live module allows saving and loading databases using one of the SQL engines.<br />
* This module reads and writes to SQL in real time. Changes to the SQL tables<br />
* will be immediately reflected into Anope. This module should not be loaded<br />
* in conjunction with db_sql.<br />
*<br />
*/<br />
#module<br />
{<br />
name = "db_sql"<br />
#name = "db_sql_live"<br />
<br />
/* <br />
* The SQL service db_sql(_live) should use, these are configured in modules.conf.<br />
* For MySQL, this should probably be mysql/main.<br />
*/ <br />
engine = "sqlite/main"<br />
<br />
/* <br />
* An optional prefix to prepended to the name of each created table.<br />
* Do not use the same prefix for other programs.<br />
*/ <br />
#prefix = "anope_db_"<br />
/* Whether or not to import data from another database module in to SQL on startup.<br />
* If you enable this, be sure that the database services is configured to use is<br />
* empty and that another database module to import from is loaded before db_sql.<br />
* After you enable this and do a database import you should disable it for<br />
* subsequent restarts.<br />
* <br />
* Note that you can not import databases using db_sql_live. If you want to import<br />
* databases and use db_sql_live you should import them using db_sql, then shut down<br />
* and start services with db_sql_live.<br />
*/<br />
import = false<br />
}<br />
<br />
</syntaxhighlight></div></div>Azander