The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download | Blog | Stats
Personal tools

Modules/sqlite3

From the makers of InspIRCd.

Jump to: navigation, search


Description
This module is a service provider module, which means it has no real directly usable functions of its own, however it provides an essential service which is used by other modules. This module allows other modules to access SQL using a unified interface, minimizing the number of persistent connections and abstracting the actual database software from the SQL queries sent to it.
Configuration Tags
To use this module you must define one or more database connections, using tags like the one below:
<database hostname="/full/path/to/database.db"
          id="anytext">

The variables in the tag have the following meanings:

  • hostname - The path to the SQLite3 database file. This must be a fully qualified path.
  • id - The id of the database. Dependent modules will use this ID to refer to the connection, rather than its credentials, so that the credentials are specified only in one place. Any text can be used as the database ID. In the previous version of the SQL API this was an integer, however it is now a string to allow for more descriptive IDs.

You may define as many databases as you wish, but remember it is most secure to only define ones that your modules will actually use.

Additional Modes
None
Additional Commands
None
Special Notes
SQLite3 databases are not very resource intensive in terms of memory usage or CPU, however they are usually for local use only. If you want to use a remote database, with more resource intensive operations (eg. date manipulation, string functions etc.) and advanced features like views, stored procedures and triggers, you should consider the m_mysql or m_pgsql modules.

Because SQLite databases are local, and don't require sockets or other marshalling code, queries to SQLite databases will block. This will not usually be an issue, especially due to the efficient design of SQLite, however you should make sure your queries are optimized and as efficient as possible.

See also: When to use SQLite

Extra ModuleThis module is an 'extra' module. This means that by default it is not compiled when you type make to build your IRCd. To enable this module follow these steps.
Dependencies
*SQLite v3.3 - The SQLite 3 Database Library