2.0/Modules/m sql

From AnopeWiki
Jump to: navigation, search
Language

English

Section Database
Module m_sql & m_sql_live
Author Anope

Description

This modules allows you to store all of nickserv, chanserv, memoserv, and operserv's data in a mysql database.

If you use m_sql_live it reads and writes the database in real time.


  • NOTE: Requres a SQL backend module to be present and properly configured.
name= 
Name of this module
engine= 
Database engine to use
prefix= 
table prefix to pre-append to table names
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)

Schema

See Mysql:Scheme for details.


Default Configuration

/*
 * db_sql and db_sql_live
 *
 * db_sql module allows saving and loading databases using one of the SQL engines.
 * This module loads the databases once on startup, then incrementally updates
 * objects in the database as they are changed within Anope in real time. Changes
 * to the SQL tables not done by Anope will have no effect and will be overwritten.
 *
 * db_sql_live module allows saving and loading databases using one of the SQL engines.
 * This module reads and writes to SQL in real time. Changes to the SQL tables
 * will be immediately reflected into Anope. This module should not be loaded
 * in conjunction with db_sql.
 *
 */
#module
{
   name = "db_sql"
   #name = "db_sql_live"
 
   /*   
    * The SQL service db_sql(_live) should use, these are configured in modules.conf.
    * For MySQL, this should probably be mysql/main.
    */   
   engine = "sqlite/main"
 
   /*   
    * An optional prefix to prepended to the name of each created table.
    * Do not use the same prefix for other programs.
    */   
   #prefix = "anope_db_"
   /* Whether or not to import data from another database module in to SQL on startup.
    * If you enable this, be sure that the database services is configured to use is
    * empty and that another database module to import from is loaded before db_sql.
    * After you enable this and do a database import you should disable it for
    * subsequent restarts.
    *    
    * Note that you can not import databases using db_sql_live. If you want to import
    * databases and use db_sql_live you should import them using db_sql, then shut down
    * and start services with db_sql_live.
    */
   import = false
}