- Partial implementation (due to lack of testing) of a sqlite interface

- Fingerprints/FingerprintMols.py: Add FingerprintsFromPickles to complement the other interfaces.
- MoleculeDescriptors.py: a bit of robustification
This commit is contained in:
Greg Landrum
2007-02-22 04:43:30 +00:00
parent e8161177ba
commit 3ec7b1404c
5 changed files with 87 additions and 7 deletions

View File

@@ -33,6 +33,27 @@ if hasattr(RDConfig,"usePgSQL") and RDConfig.usePgSQL:
placeHolder='%s'
binaryTypeName="bytea"
binaryHolder = PgBytea
elif hasattr(RDConfig,"useSqlLite") and RDConfig.useSqlLite:
useGvib=0
try:
import sqlite3 as sqlite
#from sqlite3 import *
except ImportError:
from pysqlite2 import dbapi2 as sqlite
#from pysqlite2 import *
sqlTextTypes = []
sqlIntTypes = []
sqlFloatTypes = []
sqlBinTypes = []
getTablesSql = """select name from SQLite_Master where type='table'"""
getTablesAndViewsSql = """select name from SQLite_Master where type in ('table','view')"""
getDbSql = None
dbFileWildcard='*.sqlt'
placeHolder='?'
binaryTypeName="blob"
binaryHolder = buffer
connect = lambda x,*args:sqlite.connect(x)
else:
useGvib=1
from gvib import *