Revisions
-
snaka revised this gist
Apr 29, 2009 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,7 +26,7 @@ let self = { dbConnection.executeSimpleSQL("VACUUM"); dbConnection.executeSimpleSQL("REINDEX"); } catch(e){ alert("ERROR: "+ dbConnection.databaseFile.leafName + ": " + e.message); } }, }; -
teramako revised this gist
Apr 29, 2009 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,7 +26,7 @@ let self = { dbConnection.executeSimpleSQL("VACUUM"); dbConnection.executeSimpleSQL("REINDEX"); } catch(e){ alert("ERROR: "+ dbConnection.databaseFile.leafName + ": " + e.message); } }, }; -
teramako created this gist
Apr 29, 2009 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ liberator.plugins.sqliteReorg = (function(){ const ss = Cc["@mozilla.org/storage/service;1"].getService(Ci.mozIStorageService); function getSQLiteFiles(){ let profDir = services.get("directory").get("ProfD", Ci.nsIFile); let files = profDir.directoryEntries; let reg = new RegExp("\\.sqlite$"); while (files.hasMoreElements()){ let file = files.getNext().QueryInterface(Ci.nsIFile); if (file.isFile() && reg.test(file.leafName)){ yield file; } } } let self = { start: function(){ for (let file in getSQLiteFiles()){ liberator.echomsg("Open " + file.leafName, 1); let dbc = ss.openDatabase(file); this.reorg(dbc); dbc.close(); liberator.echomsg("Close", 1); } }, reorg: function(dbConnection){ try { dbConnection.executeSimpleSQL("VACUUM"); dbConnection.executeSimpleSQL("REINDEX"); } catch(e){ alert("ERROR: "+dbConnection.databaseFile.leafName+": "+e.message); } }, }; liberator.registerObserver("shutdown", self.start); return self; })();