server/sources/native.py
branchstable
changeset 7787 d9607ae447d2
parent 7786 18a366267612
child 7839 daf46963f4fe
equal deleted inserted replaced
7786:18a366267612 7787:d9607ae447d2
  1649 
  1649 
  1650     def get_connection(self):
  1650     def get_connection(self):
  1651         return self._source.get_connection()
  1651         return self._source.get_connection()
  1652 
  1652 
  1653     def backup(self, backupfile):
  1653     def backup(self, backupfile):
  1654         archive=zipfile.ZipFile(backupfile, 'w')
  1654         archive=zipfile.ZipFile(backupfile, 'w', allowZip64=True)
  1655         self.cnx = self.get_connection()
  1655         self.cnx = self.get_connection()
  1656         try:
  1656         try:
  1657             self.cursor = self.cnx.cursor()
  1657             self.cursor = self.cnx.cursor()
  1658             self.cursor.arraysize=100
  1658             self.cursor.arraysize=100
  1659             self.logger.info('writing metadata')
  1659             self.logger.info('writing metadata')
  1745 
  1745 
  1746     def _serialize(self, name, columns, rows):
  1746     def _serialize(self, name, columns, rows):
  1747         return dumps((name, columns, rows), pickle.HIGHEST_PROTOCOL)
  1747         return dumps((name, columns, rows), pickle.HIGHEST_PROTOCOL)
  1748 
  1748 
  1749     def restore(self, backupfile):
  1749     def restore(self, backupfile):
  1750         archive = zipfile.ZipFile(backupfile, 'r')
  1750         archive = zipfile.ZipFile(backupfile, 'r', allowZip64=True)
  1751         self.cnx = self.get_connection()
  1751         self.cnx = self.get_connection()
  1752         self.cursor = self.cnx.cursor()
  1752         self.cursor = self.cnx.cursor()
  1753         sequences, tables, table_chunks = self.read_metadata(archive, backupfile)
  1753         sequences, tables, table_chunks = self.read_metadata(archive, backupfile)
  1754         for seq in sequences:
  1754         for seq in sequences:
  1755             self.logger.info('restoring sequence %s', seq)
  1755             self.logger.info('restoring sequence %s', seq)