mirror of
https://github.com/brmlab/brmbar.git
synced 2025-06-08 05:14:00 +02:00

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.
20 lines
333 B
Perl
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;
|