]> git.donarmstrong.com Git - infobot.git/commitdiff
SQLite2 also supported
authortimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 17 Dec 2004 16:23:33 +0000 (16:23 +0000)
committertimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 17 Dec 2004 16:23:33 +0000 (16:23 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@1104 c11ca15a-4712-0410-83d8-924469b57eb5

INSTALL
INSTALL.sqlite
files/sample/blootbot.config
src/dbi.pl
src/modules.pl

diff --git a/INSTALL b/INSTALL
index 08d8a638ba035088f1ea086bc2f8e0778940b246..aed3621b75880b7faa382bd7c90381a7ddd1ab4c 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -20,6 +20,7 @@ Method of installation.
 - Choose your database:
        - MySQL, read INSTALL.mysql (supported)
        - SQLite, read INSTALL.sqlite (supported)
+       - SQLite2, read INSTALL.sqlite (supported)
        - PgSQL, read INSTALL.pgsql (unsupported, may work)
 
 - There are "bugs" in the perl modules.  Read INSTALL.patches on how to fix.
index c156712c915b27aa9f95c22ff82833da1b53a019..35c6b7b3283b2fa9a3fbed9953110ef3c270c67a 100644 (file)
@@ -15,6 +15,8 @@ you if they do not already exist.
 
 other distros might need to build from sources.
 
+You may use either DBD::SQLite or DBD::SQLite2
+
 SQLite sources:
 
 http://www.hwaci.com/sw/sqlite/
index c5fff9e7c0ba683c4ca21f6e6a1ec6e889b4a61a..f8b072f6f90abe0ac7d04119e99cc52677ed3b1a 100644 (file)
@@ -34,7 +34,8 @@ set tempDir           /home/blootbot/Temp
 # [str] Ability to remember/tell factoids
 #      none    -- disable.
 #      mysql   -- ...
-#      SQLite  -- SQLite (libdbd-sqlite-perl)
+#      SQLite  -- SQLite (libdbd-sqlite-perl) (might be version 2 or 3)
+#      SQLite2 -- SQLite (libdbd-sqlite-perl) (force version 2)
 #      pgsql   -- postgresql (NOT SUPPORTED)
 ### REQUIRED by factoids,freshmeat,karma,seen,...
 set DBType             mysql
index f4c89d3a80e5caf2e096c6067b293b8feffafc0b..99d115e4d95d81a3f471faeaff568be27e2f4d39 100644 (file)
@@ -19,7 +19,7 @@ package main;
 sub sqlOpenDB {
     my ($db, $type, $user, $pass, $no_fail) = @_;
     # this is a mess. someone fix it, please.
-    if ($type =~ /^SQLite$/i) {
+    if ($type =~ /^SQLite(2)?$/i) {
        $db = "dbname=$db.sqlite";
     } elsif ($type =~ /^pg/i) {
        $db = "dbname=$db";
@@ -629,7 +629,7 @@ sub checkTables {
        &status("Tables: ".join(',',@tables));
        @db{@tables} = (1) x @tables;
 
-    } elsif ($param{DBType} =~ /^SQLite$/i) {
+    } elsif ($param{DBType} =~ /^SQLite(2)?$/i) {
 
        # retrieve a list of db's from the server.
        foreach ( &sqlRawReturn("SELECT name FROM sqlite_master WHERE type='table'") ) {
index a1cc28f256bfaca0a094e694aafa6a13dd5c82ce..17bab22094ea91ab8ba85f952aaf34dd2da86242 100644 (file)
@@ -52,7 +52,7 @@ sub loadDBModules {
     my $f;
     # TODO: use function to load module.
 
-    if ($param{'DBType'} =~ /^(mysql|SQLite|pgsql)$/i) {
+    if ($param{'DBType'} =~ /^(mysql|SQLite(2)?|pgsql)$/i) {
        eval "use DBI";
        if ($@) {
            &ERROR("No support for DBI::" . $param{'DBType'} . ", exiting!");