package CSL::DBs;

###############################################################################
# Connection strings for common CSL databases.
#
# $Id: DBs.pm,v 1.36 2023/06/24 15:29:51 mgibson Exp $

###############################################################################
# SEE THE POD DOCUMENTATION BELOW FOR MORE DETAILS
###############################################################################

# postgres CSDB
our $csdb = "dbi:Pg:dbname=csdb;host=vero.cs.wisc.edu;port=5432";

# postgres CSDB development
our $csdbdev = "dbi:Pg:dbname=csdbdev;host=vero.cs.wisc.edu;port=5432";
our $csdb2 = "dbi:Pg:dbname=csdb;host=vero2.cs.wisc.edu;port=5432";
# sushi database
our $sushi = "dbi:Pg:dbname=sushi;host=sushi-db-01.cs.wisc.edu;port=5432";

# spam userpref database
our $spamassassin = "dbi:Pg:dbname=spam;host=vero.cs.wisc.edu;port=5432";

# RT database
our $rt = "dbi:Pg:dbname=rt4;host=rtdb.cs.wisc.edu;port=5432";

# RT database
our $rt_test = "dbi:Pg:dbname=rt4test;host=vero.cs.wisc.edu;port=5432";

# user databases on postgres.cs.wisc.edu (currently stampy)
our $pgaccess = "dbi:Pg:dbname=postgres;host=stampy.cs.wisc.edu;port=5432";


# AFS Indexer
our $afs_indexer = "dbi:Pg:dbname=afs_indexer;host=chupa.cs.wisc.edu;port=5432";

# make a hash that can be used programatically
our $dbs = {
    'csdb' => $csdb,
    'csdb2' => $csdb2,
    'csdbdev' => $csdbdev,
    'sushi' => $sushi,
    'spamassassin' => $spamassassin,
    'rt' => $rt,
    'rttest' => $rttest,
    'pgaccess' => $pgaccess,
};

# begin documentation
=head1 NAME

CSL::DBs - DBI connection strings for various CSL databases

=head1 SYNOPSIS

 use CSL::DBs;
 use CSL::Pg;
 use DBI;

 my $dbh = DBI->connect($CSL::DBs::csdb);

 my $dbh = DBI->connect($CSL::DBs::dbs->{$dbname});

=head1 DESCRIPTION

This module is the one true source of DBI connect strings for CSL databases.  If you use this module you do not need to change your code if a database moves.

=head1 DATABASES

=over 4

=item C<csdb>

The current postgres CSDB server.

=item C<csdbdev>

The current postgres CSDB development server.

=item C<sushi>

The sushi database server.

=item C<spamassassin>
    
SpamAssassin database server.

=item C<rt>
    
RT database server.

=item C<pgaccess>

User databases on postgres.cs.wisc.edu.  Connects to postgres for administrative purposes. (This should be used with -su).


=item C<afs_indexer>

AFS Indexer Database for use by the AFS Indexer / Locate tool.

=back

=head1 AUTHORS

Nathan Mueller <nate@cs.wisc.edu>
Peter Koczan <koczan@cs.wisc.edu>
James Babb <babb@cs.wisc.edu>
David Parter <dparter@cs.wisc.edu>

=head1 SEE ALSO

L<DBI>

=cut

1;

