Merge branch 'master' of github.com:web2py/web2py
This commit is contained in:
+22
-21
@@ -117,6 +117,7 @@ Supported DAL URI strings:
|
|||||||
'firebird_embedded://username:password@c://path'
|
'firebird_embedded://username:password@c://path'
|
||||||
'informix://user:password@server:3050/database'
|
'informix://user:password@server:3050/database'
|
||||||
'informixu://user:password@server:3050/database' # unicode informix
|
'informixu://user:password@server:3050/database' # unicode informix
|
||||||
|
'ingres://database' # or use an ODBC connection string, e.g. 'ingres://dsn=dsn_name'
|
||||||
'google:datastore' # for google app engine datastore
|
'google:datastore' # for google app engine datastore
|
||||||
'google:sql' # for google app engine with sql (mysql compatible)
|
'google:sql' # for google app engine with sql (mysql compatible)
|
||||||
'teradata://DSN=dsn;UID=user;PWD=pass; DATABASE=database' # experimental
|
'teradata://DSN=dsn;UID=user;PWD=pass; DATABASE=database' # experimental
|
||||||
@@ -350,8 +351,9 @@ if not 'google' in DRIVERS:
|
|||||||
DRIVERS.append('MSSQL(pyodbc)')
|
DRIVERS.append('MSSQL(pyodbc)')
|
||||||
DRIVERS.append('DB2(pyodbc)')
|
DRIVERS.append('DB2(pyodbc)')
|
||||||
DRIVERS.append('Teradata(pyodbc)')
|
DRIVERS.append('Teradata(pyodbc)')
|
||||||
|
DRIVERS.append('Ingres(pyodbc)')
|
||||||
except ImportError:
|
except ImportError:
|
||||||
LOGGER.debug('no MSSQL/DB2/Teradata driver pyodbc')
|
LOGGER.debug('no MSSQL/DB2/Teradata/Ingres driver pyodbc')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import Sybase
|
import Sybase
|
||||||
@@ -413,13 +415,6 @@ if not 'google' in DRIVERS:
|
|||||||
LOGGER.debug('no SQLite/PostgreSQL driver zxJDBC')
|
LOGGER.debug('no SQLite/PostgreSQL driver zxJDBC')
|
||||||
is_jdbc = False
|
is_jdbc = False
|
||||||
|
|
||||||
try:
|
|
||||||
import ingresdbi
|
|
||||||
DRIVERS.append('Ingres(ingresdbi)')
|
|
||||||
except ImportError:
|
|
||||||
LOGGER.debug('no Ingres driver ingresdbi')
|
|
||||||
# NOTE could try JDBC.......
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import couchdb
|
import couchdb
|
||||||
DRIVERS.append('CouchDB(couchdb)')
|
DRIVERS.append('CouchDB(couchdb)')
|
||||||
@@ -3862,7 +3857,7 @@ INGRES_SEQNAME='ii***lineitemsequence' # NOTE invalid database object name
|
|||||||
# to be a delimited identifier)
|
# to be a delimited identifier)
|
||||||
|
|
||||||
class IngresAdapter(BaseAdapter):
|
class IngresAdapter(BaseAdapter):
|
||||||
drivers = ('ingresdbi',)
|
drivers = ('pyodbc',)
|
||||||
|
|
||||||
types = {
|
types = {
|
||||||
'boolean': 'CHAR(1)',
|
'boolean': 'CHAR(1)',
|
||||||
@@ -3913,6 +3908,7 @@ class IngresAdapter(BaseAdapter):
|
|||||||
adapter_args={}, do_connect=True, after_connection=None):
|
adapter_args={}, do_connect=True, after_connection=None):
|
||||||
self.db = db
|
self.db = db
|
||||||
self.dbengine = "ingres"
|
self.dbengine = "ingres"
|
||||||
|
self._driver = pyodbc
|
||||||
self.uri = uri
|
self.uri = uri
|
||||||
if do_connect: self.find_driver(adapter_args,uri)
|
if do_connect: self.find_driver(adapter_args,uri)
|
||||||
self.pool_size = pool_size
|
self.pool_size = pool_size
|
||||||
@@ -3925,17 +3921,22 @@ class IngresAdapter(BaseAdapter):
|
|||||||
connstr = connstr.lstrip()
|
connstr = connstr.lstrip()
|
||||||
while connstr.startswith('/'):
|
while connstr.startswith('/'):
|
||||||
connstr = connstr[1:]
|
connstr = connstr[1:]
|
||||||
database_name=connstr # Assume only (local) dbname is passed in
|
if '=' in connstr:
|
||||||
vnode = '(local)'
|
# Assume we have a regular ODBC connection string and just use it
|
||||||
servertype = 'ingres'
|
ruri = connstr
|
||||||
trace = (0, None) # No tracing
|
else:
|
||||||
driver_args.update(database=database_name,
|
# Assume only (local) dbname is passed in with OS auth
|
||||||
vnode=vnode,
|
database_name = connstr
|
||||||
servertype=servertype,
|
default_driver_name = 'Ingres'
|
||||||
trace=trace)
|
vnode = '(local)'
|
||||||
def connector(driver_args=driver_args):
|
servertype = 'ingres'
|
||||||
return self.driver.connect(**driver_args)
|
ruri = 'Driver={%s};Server=%s;Database=%s' % (default_driver_name, vnode, database_name)
|
||||||
|
def connector(cnxn=ruri,driver_args=driver_args):
|
||||||
|
return self.driver.connect(cnxn,**driver_args)
|
||||||
|
|
||||||
self.connector = connector
|
self.connector = connector
|
||||||
|
|
||||||
|
# TODO if version is >= 10, set types['id'] to Identity column, see http://community.actian.com/wiki/Using_Ingres_Identity_Columns
|
||||||
if do_connect: self.reconnect()
|
if do_connect: self.reconnect()
|
||||||
|
|
||||||
def create_sequence_and_triggers(self, query, table, **args):
|
def create_sequence_and_triggers(self, query, table, **args):
|
||||||
@@ -3961,12 +3962,12 @@ class IngresAdapter(BaseAdapter):
|
|||||||
return int(self.cursor.fetchone()[0]) # don't really need int type cast here...
|
return int(self.cursor.fetchone()[0]) # don't really need int type cast here...
|
||||||
|
|
||||||
def integrity_error_class(self):
|
def integrity_error_class(self):
|
||||||
return ingresdbi.IntegrityError
|
return self._driver.IntegrityError
|
||||||
|
|
||||||
|
|
||||||
class IngresUnicodeAdapter(IngresAdapter):
|
class IngresUnicodeAdapter(IngresAdapter):
|
||||||
|
|
||||||
drivers = ('ingresdbi',)
|
drivers = ('pyodbc',)
|
||||||
|
|
||||||
types = {
|
types = {
|
||||||
'boolean': 'CHAR(1)',
|
'boolean': 'CHAR(1)',
|
||||||
|
|||||||
Reference in New Issue
Block a user