3.8 Databases

A database is a logical entity associated with a particular module, that provides a specific configuration for it. In other words, database is a configured instance of the module.

Databases are declared using the following statement:

Config: database dbname modname [args]

Declare database dbname as an instance of module modname. This module should have been declared previously using the module statement (see section modname). Optional args provide configuration information for the module initialization function. They are module-specific.

To illustrate this, let's consider the ‘echo’ module, which replies to any request with a constant string supplied to it as arguments (see section echo module). The following example configures two instances of this module:

 
database nomap echo NOTFOUND No such map
database tempfail echo TEMP Try again later

The ‘nomap’ database always sends the string ‘NOTFOUND No such map’ in reply. The ‘tempfail’ database replies with the string ‘TEMP Try again later’.