diff --git a/Python/Dbase/DbInfo.py b/Python/Dbase/DbInfo.py index aba1ffa44..b2554800b 100755 --- a/Python/Dbase/DbInfo.py +++ b/Python/Dbase/DbInfo.py @@ -100,6 +100,8 @@ def GetColumnInfoFromCursor(cursor): typeStr='float' elif cType in sqlBinTypes: typeStr='binary' + elif RDConfig.useSqlLite: + typeStr='string' else: sys.stderr.write('odd type in col %s: %s\n'%(cName,str(cType))) results.append((cName,typeStr)) diff --git a/Python/RDConfig.py b/Python/RDConfig.py index 70558dab1..22afa0487 100755 --- a/Python/RDConfig.py +++ b/Python/RDConfig.py @@ -86,22 +86,25 @@ else: usePgSQL=0 useSqlLite=0 if not (os.environ.has_key('RD_USEGVIB') and os.environ['RD_USEGVIB']): - try: - from pyPgSQL import PgSQL - usePgSQL=1 - except ImportError: - usePgSQL=0 + if not os.environ.get('RD_USESQLLITE',''): try: - # python2.5 has this: - import sqlite3 - useSqlLite=True + from pyPgSQL import PgSQL + usePgSQL=1 except ImportError: + usePgSQL=0 try: - # earlier versions of python: - from pysqlite2 import dbapi2 + # python2.5 has this: + import sqlite3 useSqlLite=True - except: - pass + except ImportError: + try: + # earlier versions of python: + from pysqlite2 import dbapi2 + useSqlLite=True + except: + pass + else: + useSqlLite=True else: usePgSQL=0