brmbar-github/brmbar3/BrmBar/SQL.pm
Petr Baudis 945ee705c3 Initial implementation of brmbar v3 - brmbar v1 emulator brmbar-cli.pl
Uses PostgreSQL to store accounts and transactions, and Perl + Moose
for the implementation.

The schema is somewhat complicated, but brmburo-compatible; accounting
design by TMA.
2012-08-29 03:52:30 +02:00

20 lines
333 B
Perl

package BrmBar::SQL;
use warnings;
use strict;
use v5.10;
use utf8;
use encoding::warnings;
use open qw(:encoding(UTF-8));
use DBI;
sub init {
my ($sqlconf) = @_;
my $db = DBI->connect("dbi:Pg:dbname=brmbar", '', '', {AutoCommit => 1, RaiseError => 1, pg_enable_utf8 => 1})
or die "Cannot open db: ".DBI->errstr;
$db;
}
1;