NAME

database.conf - define stantad database layouts

SYNOPSIS

In global.conf:

 include "conf/database.conf";
 *dbLayout = $dbLayouts{layoutName};

DESCRIPTION

This file contains definitions for the commonly-used database layouts. Database layouts consist of all the information necessary to describe how to access data used by WeBWorK. For more information on the format of a database layout, consult the documentation for the WeBWorK::DB module.

A database layout is selected from the list of possible layouts by adding a line like the one below to the global.conf or course.conf file.

 $dbLayoutName = "layoutName";
 *dbLayout = $dbLayouts{$dbLayoutName};

THE GDBM DATABASE LAYOUT ($dbLayouts{gdbm})

This layout uses the traditional WeBWorK 1.x database format, using the GDBM file format. Use this layout if you wish to share courses between WeBWorK 1.x and WeBWorK 2.

The globalUserID parameter given for the set and problem tables denotes the ID of the user that the GlobalTableEmulator will use to store data for the set and problem tables. This is set to ``global_user'' by default, but can be overridden on a course-by-course basis to the ID of the professor who is most likely to be involved in creating new problem sets. Sets which have not been assigned will only be visible to this user when logging into WeBWorK 1.x.

Use the following code to override these values in a course's course.conf file:

 $dbLayout{set}->{params}->{globalUserID} = "some_user";
 $dbLayout{problem}->{params}->{globalUserID} = "some_user";

THE SQL DATABASE LAYOUT ($dbLayouts{sql})

The SQL database layout uses an SQL database server to store the tables of the WeBWorK database. The SQL driver uses two SQL accounts, a read only and a read-write account. The read-only account must have SELECT access, and the read-write account needs SELECT, INSERT, UPDATE, and DELETE access. The names and passwords of these accounts are given as parameters to each table in the layout.

 usernameRO     the name of the read-only account
 usernameRW     the name of the read-write account
 passwordRO     the password for the read-only account
 passwordRW     the password for the read-write account

Be default, the name of the read-only account is ``webworkRead'', and the name of the read-write account is ``webworkWrite''. There are no passwords by default. It is not recommended that you use only passwords to secure database access. Most RDBMSs allow IP-based authorization as well. As the system administrator, IT IS YOUR RESPONSIBILITY TO SECURE DATABASE ACCESS.

Don't confuse the accounts above with the accounts of the users of a course. These are system-wide accounts which allow WeBWorK to talk to the database server.

Other parameters that can be given are as follows:

 tableOverride  an alternate name to use when referrring to the table (used
                when a table name is a resereved word)
 fieldOverride  a hash mapping WeBWorK field names to alternate names to use
                when referring to those fields (used when one or more field
                                names are reserved words)
 debug          if true, SQL statments are printed before being executed

THE SQL_SINGLE DATABASE LAYOUT

The sql_single layout is similar to the sql layout, excpet that it uses a single database for all courses. This is accomplised by prefixing each table name with the name of the course.