def create(self, options): from relstorage.adapters.oracle import OracleAdapter config = self.config return OracleAdapter( user=config.user, password=config.password, dsn=config.dsn, options=options, )
def make_adapter(self, options): from relstorage.adapters.oracle import OracleAdapter dsn = os.environ.get('ORACLE_TEST_DSN', 'XE') if self.keep_history: db = base_dbname else: db = base_dbname + '_hf' return OracleAdapter( user=db, password='******', dsn=dsn, options=options, )
def make_adapter(self, options, db=None): dsn = os.environ.get('ORACLE_TEST_DSN', 'XE') if db is None: if self.keep_history: db = self.base_dbname else: db = self.base_dbname + '_hf' return OracleAdapter( user=db, password='******', dsn=dsn, options=options, )
def create_storage(name, blob_dir, shared_blob_dir=shared_blob_dir, keep_history=keep_history, **kw): from relstorage.storage import RelStorage from relstorage.adapters.oracle import OracleAdapter db = db_names[name] if not keep_history: db += '_hf' options = Options( keep_history=keep_history, shared_blob_dir=shared_blob_dir, blob_dir=os.path.abspath(blob_dir), **kw) adapter = OracleAdapter( user=db, password='******', dsn=dsn, options=options, ) storage = RelStorage(adapter, name=name, options=options) storage.zap_all() return storage
def factory(options): from relstorage.adapters.oracle import OracleAdapter return OracleAdapter(options=options, **kw)
options=Options(keep_history=keep_history), ) elif use == 'postgresql': from relstorage.adapters.postgresql import PostgreSQLAdapter a = PostgreSQLAdapter(dsn= "dbname='packtest' " 'user=relstoragetest ' 'password=relstoragetest', options=Options(keep_history=keep_history), ) elif use == 'oracle': from relstorage.adapters.oracle import OracleAdapter dsn = os.environ.get('ORACLE_TEST_DSN', 'XE') a = OracleAdapter( user='******', password='******', dsn=dsn, options=Options(keep_history=keep_history), ) else: raise AssertionError("which database?") s = RelStorage(a) d = DB(s) c = d.open() print 'size:' print d.getSize() if 1: print 'initializing...' container = PersistentMapping()