#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
--- /dev/null
+#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:
+<DBI_DRV_PRFIX<DBI:Pg:host=localhost;dbname=>
+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!
+
+
<<AUTO_LOGIN</>
# BACKUP_ENABLED -> Enable (1), disable (0) backups to be restored from config page.
<<BACKUP_ENABLED<1>
-# Default database driver prefix, is SQLite.
-<<DBI_DRV_PRFIX<DBI:SQLite:dbname=>
+# Default database driver prefix, for SQLite.
+<<DBI_DRV_PRFIX_SQLITE<DBI:SQLite:dbname=>
+# Progress DB driver (must have database, the user(alias) and password, pre-created or set)
+<<DBI_DRV_PRFIX<DBI:Pg:host=localhost;dbname=>
<<CONFIG<4>
00|$RELEASE_VER = 2.1`LifeLog Application Version.
01|$REC_LIMIT = 25`Records shown per page.
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.
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=>"<p>Error->"& $DBI::errstri &"</p>$!", show_trace=>1);
}