server/sources/native.py
changeset 5849 9db65b381028
parent 5768 1e73a466aa69
parent 5847 51636c991fb4
child 5891 99024ad59223
equal deleted inserted replaced
5840:60880c81e32e 5849:9db65b381028
   273                 cnx.close()
   273                 cnx.close()
   274             self.pool_reset = pool_reset
   274             self.pool_reset = pool_reset
   275         if self.dbdriver == 'sqlite':
   275         if self.dbdriver == 'sqlite':
   276             self._create_eid = None
   276             self._create_eid = None
   277             self.create_eid = self._create_eid_sqlite
   277             self.create_eid = self._create_eid_sqlite
       
   278         self.binary_to_str = self.dbhelper.dbapi_module.binary_to_str
       
   279 
   278 
   280 
   279     @property
   281     @property
   280     def _sqlcnx(self):
   282     def _sqlcnx(self):
   281         # XXX: sqlite connections can only be used in the same thread, so
   283         # XXX: sqlite connections can only be used in the same thread, so
   282         #      create a new one each time necessary. If it appears to be time
   284         #      create a new one each time necessary. If it appears to be time
   670                 pass
   672                 pass
   671             raise
   673             raise
   672 
   674 
   673     # short cut to method requiring advanced db helper usage ##################
   675     # short cut to method requiring advanced db helper usage ##################
   674 
   676 
   675     def binary_to_str(self, value):
       
   676         return self.dbhelper.dbapi_module.binary_to_str(value)
       
   677 
       
   678     def create_index(self, session, table, column, unique=False):
   677     def create_index(self, session, table, column, unique=False):
   679         cursor = LogCursor(session.pool[self.uri])
   678         cursor = LogCursor(session.pool[self.uri])
   680         self.dbhelper.create_index(cursor, table, column, unique)
   679         self.dbhelper.create_index(cursor, table, column, unique)
   681 
   680 
   682     def drop_index(self, session, table, column, unique=False):
   681     def drop_index(self, session, table, column, unique=False):
   683         cursor = LogCursor(session.pool[self.uri])
   682         cursor = LogCursor(session.pool[self.uri])
   684         self.dbhelper.drop_index(cursor, table, column, unique)
   683         self.dbhelper.drop_index(cursor, table, column, unique)
       
   684 
       
   685     def change_col_type(self, session, table, column, coltype, null_allowed):
       
   686         cursor = LogCursor(session.pool[self.uri])
       
   687         self.dbhelper.change_col_type(cursor, table, column, coltype, null_allowed)
       
   688 
       
   689     def set_null_allowed(self, session, table, column, coltype, null_allowed):
       
   690         cursor = LogCursor(session.pool[self.uri])
       
   691         self.dbhelper.set_null_allowed(cursor, table, column, coltype, null_allowed)
   685 
   692 
   686     # system source interface #################################################
   693     # system source interface #################################################
   687 
   694 
   688     def eid_type_source(self, session, eid):
   695     def eid_type_source(self, session, eid):
   689         """return a tuple (type, source, extid) for the entity with id <eid>"""
   696         """return a tuple (type, source, extid) for the entity with id <eid>"""