sqlite_db_engine = create_engine('sqlite:///%s' % str(dbname),connect_args = {'PRAGMA journal_mode':'MEMORY','PRAGMA synchronous':'OFF','PRAGMA temp_store':'MEMORY','PRAGMA cache_size':'5000000'}) db = sqlite_db_engine.connect()
和这个:
sqlite_db_engine = create_engine('sqlite:///%s' % str(dbname)) db = sqlite_db_engine.connect() db.execute("PRAGMA journal_mode = MEMORY") db.execute("PRAGMA synchronous = OFF") db.execute("PRAGMA temp_store = MEMORY") db.execute("PRAGMA cache_size = 500000")
没有运气对于长时间的事务,我仍然可以看到.journal文件正在磁盘上创建.是否有另一种方式来设定?
*注意我用内置的python sqlite模块没有问题