Пример #1
0
 def setup_destination(self):
     dest = MassSpecDatabaseAdapter()
     dest.trait_set(name='massspecdata_crow',
                    kind='mysql',
                    username='******',
                    password='******')
     self.destination = dest
Пример #2
0
 def setup_destination(self):
     dest = MassSpecDatabaseAdapter()
     dest.trait_set(name='massspecdata_crow',
                    kind='mysql',
                    username='******',
                    password='******')
     self.destination = dest
Пример #3
0
    def _secondary_db_default(self):
        from apptools.preferences.preference_binding import bind_preference

        db = MassSpecDatabaseAdapter()
        prefid = 'pychron.massspec.database'
        bind_preference(db, 'host', '{}.host'.format(prefid))
        bind_preference(db, 'username', '{}.username'.format(prefid))
        bind_preference(db, 'name', '{}.name'.format(prefid))
        bind_preference(db, 'password', '{}.password'.format(prefid))
        return db
Пример #4
0
def massspec_db_factory(path, remove=True):
    from pychron.database.adapters.massspec_database_adapter import MassSpecDatabaseAdapter
    from pychron.database.orms.massspec_orm import Base

    if remove and os.path.isfile(path):
        os.remove(path)

    db = MassSpecDatabaseAdapter()
    # db.verbose_retrieve_query = True
    db.trait_set(kind='sqlite', path=path)
    db.connect()

    metadata = Base.metadata
    db.create_all(metadata)
    return db
Пример #5
0
def massspec_db_factory(path, remove=True):
    from pychron.database.adapters.massspec_database_adapter import MassSpecDatabaseAdapter
    from pychron.database.orms.massspec_orm import Base

    if remove and os.path.isfile(path):
        os.remove(path)

    db = MassSpecDatabaseAdapter()
    # db.verbose_retrieve_query = True
    db.trait_set(kind='sqlite', path=path)
    db.connect()

    metadata = Base.metadata
    db.create_all(metadata)
    return db
Пример #6
0
    def _db_default(self):
        db = MassSpecDatabaseAdapter(kind='mysql')

        return db
Пример #7
0
    def _db_default(self):
        db = MassSpecDatabaseAdapter(kind='mysql', autoflush=False)

        return db