我正在尝试使用Python(传统的,2.7)和SQLite(3)来编写书籍索引器.
代码归结为这一系列SQL语句:
'select count(*) from tag_dict' ()
/* [(30,)] */
'select count(*) from file_meta' ()
/* [(63613,)] */
'begin transaction' ()
'select id from archive where name=?' ('158326-158457.zip',)
/* [(20,)] */
'select id from file where name=? and archive=?' ('158328.fb2', 20)
/* [(122707,)] */
'delete from file_meta where file=?' (122707,)
'commit transaction' ()
# error: cannot commit - no transaction is active
Run Code Online (Sandbox Code Playgroud)
隔离级别为"DEFERRED"("EXCLUSIVE"并不是更好).
我试图使用connection.commit()而不是cursor.execute('commit') - 没有任何用处.
是的,我对 Fossil\xe2\x80\xa6 很陌生
\n\n在我的实验过程中,我遇到了一个问题:fossil all info命令列出了这里曾经触及的所有存储库,包括那些已删除/删除/丢弃/删除/删除的存储库,显然失败了
************* /home/jno/src/dropped-repo.fossil *****************************************\nSQLITE_CANTOPEN: cannot open file at line 36667 of [0c55d17973]\nSQLITE_CANTOPEN: os_unix.c:36667: (21) open(/home/jno/src/dropped-repo.fossil) - \nfossil: [/home/jno/src/dropped-repo.fossil]: unable to open database file\nRun Code Online (Sandbox Code Playgroud)\n\n是的,--dontstop旗帜让生活变得更轻松,但并不能解决问题。
那么,问题是:如何正确删除存储库?
\n\n到目前为止我发现的唯一方法是:
\n\nfossil close它sqlite3 ~/.fossil并delete from global_config where name=\'\xe2\x80\xa6\'在所有提到该存储库的地方。这看起来很难看。
\n\n我看到一个new/init命令来创建一个存储库,但我看不到如何删除它。
附言。Fossil的食谱:“不是有效的存储库” - 已删除的存储库(只是 …