#! /usr/bin/perl
use DBI;
require './config.pm';
package autoeconomy;

sub db_connect {
	my $dbh = DBI->connect("dbi:Pg:" .
		"dbname=" . $autoeconomy::config::dbname . ";" .
		"host=" . $autoeconomy::config::dbhost,
		$autoeconomy::config::dbuser,
		$autoeconomy::config::dbpass)
		or die "Couldn't connect to database: " . DBI::errstr();
	$dbh->{RaiseError} = 1;
	return $dbh;
}

1;
