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.
This commit is contained in:
Petr Baudis 2012-08-29 03:52:30 +02:00
parent 540167bfb5
commit 945ee705c3
7 changed files with 521 additions and 0 deletions

20
brmbar3/BrmBar/SQL.pm Normal file
View file

@ -0,0 +1,20 @@
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;