Name

DatabaseDefault — specify default settings for Database directives

SYNOPSIS

DESCRIPTION

The directive defines default parameters for a database.

For a list of possible parameters (keys), see the Database directive.

DatabaseDefault accepts scalar keys, which actually means all from the list above except:

  • ALTERNATE_*

  • BINARY

  • COLUMN_DEF

  • DEFAULT

  • FIELD_ALIAS

  • FILTER_*

  • NAME

  • NUMERIC

  • POSTCREATE

  • WRITE_CATALOG

DIRECTIVE TYPE AND DEFAULT VALUE

Catalog directive

EXAMPLES

Example: Specify default SQL connection username and password

Most Interchange applications use only one SQL database. In that case, it is handy to specify the default SQL username and password once, instead of repeating it for each table separately. Here's a possible catalog.cfg setting:

DatabaseDefault USER interchange
DatabaseDefault PASS nevairbe

Example: Specifying WRITE_CONTROL and WRITE_TAGGED defaults

DatabaseDefault      WRITE_CONTROL   1
DatabaseDefault      WRITE_TAGGED    1

Example: Clearing default values

Replace DatabaseDefault

NOTES

Those default settings are made when the table is initially defined, so explicit settings for the database itself override the defaults, of course.

To have the intended effect, this directive must be set before the appropriate databases are defined with the Database directive.

For a way to clear definitions, use the Replace directive.

AVAILABILITY

DatabaseDefault is available in Interchange versions:

4.8.0-5.7.0 (cvs-head)

SOURCE

Interchange 5.7.0:

Source: lib/Vend/Config.pm
Line 583

['DatabaseDefault',  'hash',          ''],

Source: lib/Vend/Config.pm
Line 3132 (context shows lines 3132-3149)

sub parse_hash {
my($item,$settings) = @_;
if (! $settings) {
  return $HashDefaultBlank{$item} ? '' : {};
}

my $c;

if(defined $C) {
  $c = $C->{$item} || {};
}
else {
  no strict 'refs';
  $c = ${"Global::$item"} || {};
}

return hash_string($settings,$c);
}

AUTHORS

Interchange Development Group

SEE ALSO

Replace(7ic), Database(7ic), DatabaseAuto(7ic)

DocBook! Interchange!