예제 #1
0
def __open_database():
    global _db
    if not os.path.exists(get_data_dir()):
        os.makedirs(get_data_dir())
    _db = SqliteQueueDatabase(os.path.join(get_data_dir(), "cozy.db"),
                              queue_max_size=128,
                              results_timeout=15.0,
                              timeout=15.0,
                              pragmas=[('cache_size', -1024 * 32),
                                       ('journal_mode', 'wal')])
예제 #2
0
def __open_database():
    global _db
    if not os.path.exists(get_data_dir()):
        os.makedirs(get_data_dir())
    _db = PooledSqliteDatabase(os.path.join(get_data_dir(), "cozy.db"),
                               pragmas=[('journal_mode', 'wal')])
예제 #3
0
def database_file_exists():
    return os.path.exists(os.path.join(get_data_dir(), "cozy.db"))
예제 #4
0
파일: model_base.py 프로젝트: leuc/cozy
def __open_database():
    global _db
    if not os.path.exists(get_data_dir()):
        os.makedirs(get_data_dir())
    _db = APSWDatabase(os.path.join(get_data_dir(), "cozy.db"), timeout=5, pragmas=[('journal_mode', 'wal')])