resynced recent patches, sorry for the mess
This commit is contained in:
+11
-11
@@ -476,7 +476,7 @@ def quote_keyword(a,keyword='timestamp'):
|
||||
regex = re.compile('\.keyword(?=\w)')
|
||||
a = regex.sub('."%s"' % keyword,a)
|
||||
return a
|
||||
|
||||
|
||||
if 'google' in DRIVERS:
|
||||
|
||||
is_jdbc = False
|
||||
@@ -1188,7 +1188,7 @@ class BaseAdapter(ConnectionPool):
|
||||
self.file_delete(table._dbt)
|
||||
logfile.write('success!\n')
|
||||
|
||||
def _insert(self, table, fields):
|
||||
def _insert(self, table, fields):
|
||||
if fields:
|
||||
keys = ','.join(f.name for f, v in fields)
|
||||
values = ','.join(self.expand(v, f.type) for f, v in fields)
|
||||
@@ -1309,7 +1309,7 @@ class BaseAdapter(ConnectionPool):
|
||||
return ftype in ('integer','boolean','double','bigint') or \
|
||||
ftype.startswith('decimal')
|
||||
|
||||
def REPLACE(self, first, (second, third)):
|
||||
def REPLACE(self, first, (second, third)):
|
||||
return 'REPLACE(%s,%s,%s)' % (self.expand(first,'string'),
|
||||
self.expand(second,'string'),
|
||||
self.expand(third,'string'))
|
||||
@@ -1614,7 +1614,7 @@ class BaseAdapter(ConnectionPool):
|
||||
sql_t = ', '.join([self.table_alias(t) for t in excluded + \
|
||||
tables_to_merge.keys()])
|
||||
if joint:
|
||||
sql_t += ' %s %s' % (command,
|
||||
sql_t += ' %s %s' % (command,
|
||||
','.join([self.table_alias(t) for t in joint]))
|
||||
for t in joinon:
|
||||
sql_t += ' %s %s' % (command, t)
|
||||
@@ -1629,7 +1629,7 @@ class BaseAdapter(ConnectionPool):
|
||||
for t in ijoinon:
|
||||
sql_t += ' %s %s' % (icommand, t)
|
||||
if joint:
|
||||
sql_t += ' %s %s' % (command,
|
||||
sql_t += ' %s %s' % (command,
|
||||
','.join([self.table_alias(t) for t in joint]))
|
||||
for t in joinon:
|
||||
sql_t += ' %s %s' % (command, t)
|
||||
@@ -1807,7 +1807,7 @@ class BaseAdapter(ConnectionPool):
|
||||
if field_is_type('list:string'):
|
||||
obj = map(str,obj)
|
||||
else:
|
||||
obj = map(int,obj)
|
||||
obj = map(int,[o for o in obj if o != ''])
|
||||
# we don't want to bar_encode json objects
|
||||
if isinstance(obj, (list, tuple)) and (not fieldtype == "json"):
|
||||
obj = bar_encode(obj)
|
||||
@@ -3047,7 +3047,7 @@ class OracleAdapter(BaseAdapter):
|
||||
END IF;
|
||||
SELECT %(sequence_name)s.nextval INTO :NEW.%(id)s FROM DUAL;
|
||||
END;
|
||||
""" % dict(trigger_name=trigger_name, tablename=tablename,
|
||||
""" % dict(trigger_name=trigger_name, tablename=tablename,
|
||||
sequence_name=sequence_name,id=id_name))
|
||||
|
||||
def lastrowid(self,table):
|
||||
@@ -8021,7 +8021,7 @@ def index():
|
||||
ofile.write('END')
|
||||
|
||||
def import_from_csv_file(self, ifile, id_map=None, null='<NULL>',
|
||||
unique='uuid', map_tablenames=None,
|
||||
unique='uuid', map_tablenames=None,
|
||||
ignore_missing_tables=False,
|
||||
*args, **kwargs):
|
||||
#if id_map is None: id_map={}
|
||||
@@ -8041,7 +8041,7 @@ def index():
|
||||
tablename = map_tablenames.get(tablename,tablename)
|
||||
if tablename is not None and tablename in self.tables:
|
||||
self[tablename].import_from_csv_file(
|
||||
ifile, id_map, null, unique, id_offset,
|
||||
ifile, id_map, null, unique, id_offset,
|
||||
*args, **kwargs)
|
||||
elif tablename is None or ignore_missing_tables:
|
||||
# skip all non-empty lines
|
||||
@@ -8484,7 +8484,7 @@ class Table(object):
|
||||
def __repr__(self):
|
||||
return '<Table %s (%s)>' % (self._tablename,','.join(self.fields()))
|
||||
|
||||
def __str__(self):
|
||||
def __str__(self):
|
||||
if self._ot is not None:
|
||||
if 'Oracle' in str(type(self._db._adapter)): # <<< patch
|
||||
return '%s %s' % (self._ot, self._tablename) # <<< patch
|
||||
@@ -10194,7 +10194,7 @@ class Rows(object):
|
||||
return len(self.records)
|
||||
|
||||
def __getslice__(self, a, b):
|
||||
return Rows(self.db,self.records[a:b],self.colnames)
|
||||
return Rows(self.db,self.records[a:b],self.colnames,compact=self.compact)
|
||||
|
||||
def __getitem__(self, i):
|
||||
row = self.records[i]
|
||||
|
||||
Reference in New Issue
Block a user