From: Will Budicm Date: Thu, 17 Sep 2020 08:51:57 +0000 (+1000) Subject: progress dev. prerqsts. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=fe0ff2884b575b3c8cc5e671b2d5bc0a48f57bf1;p=LifeLog.git progress dev. prerqsts. --- diff --git a/Installation.txt b/Installation.txt index fe9bc8b..e96c668 100644 --- a/Installation.txt +++ b/Installation.txt @@ -90,6 +90,8 @@ sudo cpan Text::Markdown #Install DBI module sudo cpan DBI; sudo cpan DBD::SQLite; +#For ProgrsSQL see Installation_ProgresSQL.txt before installing perl driver: +#cpan DBD::Pg; #Final Perl Installation Notes diff --git a/Installation_ProgresSQL.txt b/Installation_ProgresSQL.txt new file mode 100644 index 0000000..722fb3f --- /dev/null +++ b/Installation_ProgresSQL.txt @@ -0,0 +1,34 @@ +#Install ProgresSQL +sudo mkdir /usr/include/postgresql +sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main" > \ +/etc/apt/sources.list.d/postgresql.list' +sudo apt update -y +sudo apt upgrade -y +sudo apt install postgresql-12 -y + +##Install required libpq-dev to compile test perl driver, later. +sudo apt install libpq-dev + +##Install perl driver. +sudo cpan DBD::Pg; + + +###manually Obtain dep. if encountering lib problems. with i.e.: +wget https://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-12/libpq-dev_12.4-1.pgdg20.04+1_amd64.deb +dpkg -i libpq-dev_12.4-1.pgdg20.04+1_amd64.deb +###Than run again driver install +sudo cpan DBD::Pg; + +#Notes + +ProgresSQL Server is an full database service solution. So interaction, like databases, users and backups. +These are all handled outside the scope of the LifeLog application. You will need to set this up, +prior of using this application. And make an setting in main.cnf that this is handled outside. +Mainly what driver you are using. In this case it is the ProgresSQL one. Modify the Anon property to say: + +Don't specify the dbname. You don't need to run a schema, as on a new blank database, all will be created. +The alias is assumed the database name, and the user. + +Hope all works for you, and happy logging! + + diff --git a/dbLifeLog/main.cnf b/dbLifeLog/main.cnf index 69d3d28..d87a0e7 100644 --- a/dbLifeLog/main.cnf +++ b/dbLifeLog/main.cnf @@ -7,8 +7,10 @@ Credential format:< , don't enable here using AU < # BACKUP_ENABLED -> Enable (1), disable (0) backups to be restored from config page. < -# Default database driver prefix, is SQLite. -< +# Default database driver prefix, for SQLite. +< +# Progress DB driver (must have database, the user(alias) and password, pre-created or set) +< < 00|$RELEASE_VER = 2.1`LifeLog Application Version. 01|$REC_LIMIT = 25`Records shown per page. diff --git a/htdocs/cgi-bin/system/modules/Settings.pm b/htdocs/cgi-bin/system/modules/Settings.pm index 477fabd..a5d0a27 100644 --- a/htdocs/cgi-bin/system/modules/Settings.pm +++ b/htdocs/cgi-bin/system/modules/Settings.pm @@ -39,6 +39,7 @@ our $COMPRESS_ENC = 0; #HTTP Compressed encoding. our $DBI_DRV_PRFIX= "DBI:SQLite:dbname="; our $DSN; our $DBFILE; +our $IS_PROGRESSDB=0; #Annons here, variables that could be overiden in code or database, per need. @@ -440,7 +441,11 @@ sub configProperty { sub connectDB { my ($a,$p) = @_; $DBFILE = $LOG_PATH.'data_'.$a.'_log.db'; - $DSN= $DBI_DRV_PRFIX.$DBFILE; + $DSN= $DBI_DRV_PRFIX.$DBFILE; + if (rindex ($DBI_DRV_PRFIX ,'DBI:Pg') ==0) {#progress + $DSN=$DBI_DRV_PRFIX.$a; $p=$a; + $IS_PROGRESSDB = 1; + } return DBI->connect($DSN, $a, $p, { RaiseError => 1, PrintError => 0}) or LifeLogException->throw(error=>"

Error->"& $DBI::errstri &"

$!", show_trace=>1); }