Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-minidb for openSUSE:Factory 
checked in at 2022-09-30 17:57:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-minidb (Old)
 and      /work/SRC/openSUSE:Factory/.python-minidb.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-minidb"

Fri Sep 30 17:57:43 2022 rev:7 rq:1007060 version:2.0.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-minidb/python-minidb.changes      
2021-09-09 23:07:50.384851540 +0200
+++ /work/SRC/openSUSE:Factory/.python-minidb.new.2275/python-minidb.changes    
2022-09-30 17:58:02.533280390 +0200
@@ -1,0 +2,6 @@
+Thu Sep 29 16:20:05 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com>
+
+- Update to  minidb 2.0.6
+  * Add vacuum_on_close option and Store.vacuum()
+
+-------------------------------------------------------------------

Old:
----
  minidb-2.0.5.tar.gz

New:
----
  minidb-2.0.6.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-minidb.spec ++++++
--- /var/tmp/diff_new_pack.pJGPfr/_old  2022-09-30 17:58:02.913281202 +0200
+++ /var/tmp/diff_new_pack.pJGPfr/_new  2022-09-30 17:58:02.917281211 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-minidb
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -21,7 +21,7 @@
 %define         skip_python2 1
 %bcond_without  test
 Name:           python-minidb
-Version:        2.0.5
+Version:        2.0.6
 Release:        0
 Summary:        SQLite3-based store for Python objects
 License:        ISC

++++++ minidb-2.0.5.tar.gz -> minidb-2.0.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/minidb-2.0.5/README.md new/minidb-2.0.6/README.md
--- old/minidb-2.0.5/README.md  2021-06-06 12:47:04.000000000 +0200
+++ new/minidb-2.0.6/README.md  2022-02-17 12:04:53.000000000 +0100
@@ -33,6 +33,13 @@
 db.close() to flush the changes to disk, and optionally db.commit() if you
 want to save the changes to disk without closing the database.
 
+By default, `minidb` executes `VACUUM` on the SQLite database on close. You
+can opt-out of this behaviour by passing `vacuum_on_close=False` to the
+`minidb.Store` constructor. You can manually execute a `VACUUM` by calling
+`.vacuum()` on the `minidb.Store` object, this helps reduce the file size
+in case you delete many objects at once. See the
+[SQLite VACUUM docs](https://www.sqlite.org/lang_vacuum.html) for details.
+
 To actually store objects, we need to subclass from minidb.Model (which takes
 care of all the behind-the-scenes magic for making your class persistable, and
 adds methods for working with the database):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/minidb-2.0.5/minidb.py new/minidb-2.0.6/minidb.py
--- old/minidb-2.0.5/minidb.py  2021-06-06 12:47:04.000000000 +0200
+++ new/minidb-2.0.6/minidb.py  2022-02-17 12:04:53.000000000 +0100
@@ -5,7 +5,7 @@
 #    |_|_|_|_|_||_|_\__,_|_.__/
 #    simple python object store
 #
-# Copyright 2009-2010, 2014-2021 Thomas Perl <thp.io>. All rights reserved.
+# Copyright 2009-2010, 2014-2022 Thomas Perl <thp.io>. All rights reserved.
 #
 # Permission to use, copy, modify, and/or distribute this software for any
 # purpose with or without fee is hereby granted, provided that the above
@@ -36,7 +36,7 @@
 
 
 __author__ = 'Thomas Perl <m...@thp.io>'
-__version__ = '2.0.5'
+__version__ = '2.0.6'
 __url__ = 'http://thp.io/2010/minidb/'
 __license__ = 'ISC'
 
@@ -130,10 +130,11 @@
     PRIMARY_KEY = ('id', int)
     MINIDB_ATTR = '_minidb'
 
-    def __init__(self, filename=':memory:', debug=False, smartupdate=False):
+    def __init__(self, filename=':memory:', debug=False, smartupdate=False, 
vacuum_on_close=True):
         self.db = sqlite3.connect(filename, check_same_thread=False)
         self.debug = debug
         self.smartupdate = smartupdate
+        self.vacuum_on_close = vacuum_on_close
         self.registered = {}
         self.lock = threading.RLock()
 
@@ -165,10 +166,15 @@
         with self.lock:
             self.db.commit()
 
+    def vacuum(self):
+        with self.lock:
+            self._execute('VACUUM')
+
     def close(self):
         with self.lock:
             self.db.isolation_level = None
-            self._execute('VACUUM')
+            if self.vacuum_on_close:
+                self._execute('VACUUM')
             self.db.close()
 
     def _ensure_schema(self, table, slots):

Reply via email to