]> lifelog.hopto.org Git - LifeLog.git/commitdiff
progress dev. prerqsts.
authorWill Budicm <redacted>
Thu, 17 Sep 2020 08:51:57 +0000 (18:51 +1000)
committerWill Budicm <redacted>
Thu, 17 Sep 2020 08:51:57 +0000 (18:51 +1000)
Installation.txt
Installation_ProgresSQL.txt [new file with mode: 0644]
dbLifeLog/main.cnf
htdocs/cgi-bin/system/modules/Settings.pm

index fe9bc8b42a0c874e85bb32d42414d680a1ea7fec..e96c6682a3139502d89d9038a7fc7c9d68406218 100644 (file)
@@ -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 (file)
index 0000000..722fb3f
--- /dev/null
@@ -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:
+<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!
+
+
index 69d3d28d88424d5c2da4fb1ccd53bb6a0ae4e212..d87a0e76b895a8fdc5827f91e945272edfd71818 100644 (file)
@@ -7,8 +7,10 @@ Credential format:<<AUTO_LOGIN <{alias}/{password}> , don't enable here using AU
 <<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.
index 477fabd8878d725c693d3702540fa0d3b18d778f..a5d0a279924ca9f4d7dc213ee3cbd96bdc142fd8 100644 (file)
@@ -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=>"<p>Error->"& $DBI::errstri &"</p>$!",  show_trace=>1);
 }