server/sources/native.py
branchstable
changeset 9701 46c8d8701240
parent 9492 c7fc56eecd1a
child 9770 112c884b2d8d
child 9928 0d831b40fa48
equal deleted inserted replaced
9700:da7d341cca76 9701:46c8d8701240
   737             cnx = session.cnxset.connection(self.uri)
   737             cnx = session.cnxset.connection(self.uri)
   738             # getattr to get the actual connection if cnx is a ConnectionWrapper
   738             # getattr to get the actual connection if cnx is a ConnectionWrapper
   739             # instance
   739             # instance
   740             print 'exec', query, args, getattr(cnx, '_cnx', cnx)
   740             print 'exec', query, args, getattr(cnx, '_cnx', cnx)
   741         try:
   741         try:
   742             # str(query) to avoid error if it's an unicode string
   742             # str(query) to avoid error if it's a unicode string
   743             cursor.execute(str(query), args)
   743             cursor.execute(str(query), args)
   744         except Exception as ex:
   744         except Exception as ex:
   745             if self.repo.config.mode != 'test':
   745             if self.repo.config.mode != 'test':
   746                 # during test we get those message when trying to alter sqlite
   746                 # during test we get those message when trying to alter sqlite
   747                 # db schema
   747                 # db schema
   777         """
   777         """
   778         if server.DEBUG & server.DBG_SQL:
   778         if server.DEBUG & server.DBG_SQL:
   779             print 'execmany', query, 'with', len(args), 'arguments'
   779             print 'execmany', query, 'with', len(args), 'arguments'
   780         cursor = session.cnxset[self.uri]
   780         cursor = session.cnxset[self.uri]
   781         try:
   781         try:
   782             # str(query) to avoid error if it's an unicode string
   782             # str(query) to avoid error if it's a unicode string
   783             cursor.executemany(str(query), args)
   783             cursor.executemany(str(query), args)
   784         except Exception as ex:
   784         except Exception as ex:
   785             if self.repo.config.mode != 'test':
   785             if self.repo.config.mode != 'test':
   786                 # during test we get those message when trying to alter sqlite
   786                 # during test we get those message when trying to alter sqlite
   787                 # db schema
   787                 # db schema