mirror of
https://github.com/brmlab/brmbar.git
synced 2025-12-16 04:34:01 +01:00
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:
parent
540167bfb5
commit
945ee705c3
7 changed files with 521 additions and 0 deletions
20
brmbar3/BrmBar/SQL.pm
Normal file
20
brmbar3/BrmBar/SQL.pm
Normal 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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue