Esempio n. 1
0
 def create_qs_graph(self):
     cpe = MyClassPatternExtractor(Base._decl_class_registry)
     qs = QuadStorage(self.qsname, cpe, nsm=nsm, add_default=False)
     g = GraphQuadMapPattern(self.graphname, qs, None, None)
     qs.alias_manager = cpe  # Hack
     cpe.add_class(A, g)
     cpe.add_class(B, g)
     cpe.add_class(C, g)
     cpe.add_class(D, g)
     return qs, g, cpe
Esempio n. 2
0
 def tearDown(self):
     qs = QuadStorage(self.qsname, None, nsm=nsm)
     try:
         print(qs.drop(session, True))
         for table in ("test_d", "test_c", "test_b", "test_a"):
             session.execute('delete from test..'+table)
         session.commit()
     except Exception as e:
         print(e)
         session.rollback()
Esempio n. 3
0
 def drop_storage(self, storage_name, force=True):
     qs = QuadStorage(storage_name, None, nsm=self.nsm)
     try:
         qs.drop(self.session, force)
     except Exception as e:
         print e
Esempio n. 4
0
 def drop_storage(self, storage_name, force=True):
     qs = QuadStorage(storage_name, None, nsm=self.nsm)
     try:
         qs.drop(self.session, force)
     except Exception as e:
         print e
Esempio n. 5
0
 def prepare_storage(self, quad_storage_name, imported=None):
     cpe = AssemblClassPatternExtractor(Base._decl_class_registry)
     qs = QuadStorage(quad_storage_name, cpe, imported, False, nsm=self.nsm)
     return qs, cpe