From faa62f4281a49c725a98040e2fada73071ca81be Mon Sep 17 00:00:00 2001 From: "E. H. Rast" Date: Sat, 14 Sep 2019 22:20:16 +0100 Subject: [PATCH] Use PRAGMA optimize when MDB is closed. --- minidb.go | 1 + 1 file changed, 1 insertion(+) diff --git a/minidb.go b/minidb.go index 7abd6c8..b1af116 100644 --- a/minidb.go +++ b/minidb.go @@ -419,6 +419,7 @@ func (db *MDB) Backup(destination string) error { // Close closes the database, making sure that all remaining transactions are finished. func (db *MDB) Close() error { if db.base != nil { + _, _ = db.base.Exec(`PRAGMA optimize;`) err := db.base.Close() if err != nil { return Fail("ERROR Failed to close database - %s.\n", err)