NAME

GT::DB::pg - Access to PostgreSQL database of quotes


DESCRIPTION

This module is used to retry quotes from a Postgresql database. By default, the database is supposed to be running on localhost and the only authentication done is the standard Unix one.

Configuration

You can put some configuration items in ~/.gt/options to indicate where the database is.

DB::pg::dbname : the name of the database ("cours" by default)
DB::pg::dbhost : the host of the database ("" = localhost by default)
DB::pg::dbuser : the user account on the database
DB::pg::dbpasswd : the password of the user account

Functions

GT::DB::pg->new()
$db->disconnect

Disconnects from the database.

$db->get_prices($code, $timeframe)

Returns a GT::Prices object containing all known prices for the symbol $code.

$db->get_last_prices($code, $limit, $timeframe)

Returns a GT::Prices object containing the $limit last known prices for the symbol $code.

$db->get_db_name($code)

Returns the name of the stock designated by $code.