diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6a7098ee..18044c68 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,7 @@ Changelog This document records the main changes to the ``sdssdb`` code. * Add ``ForeignKeyField`` to ``TIC_v8`` where for all models in ``catalogdb`` connected to Gaia. +* Use ``autorollback=True`` by default in `.PeeweeDatabaseConnection`. * :release:`0.4.2 <2020-06-05>` * Add schema for ``gaia_dr2_ruwe``. diff --git a/python/sdssdb/connection.py b/python/sdssdb/connection.py index d5f55ed4..186acd5b 100644 --- a/python/sdssdb/connection.py +++ b/python/sdssdb/connection.py @@ -341,7 +341,9 @@ def __init__(self, *args, **kwargs): self._metadata = {} - PostgresqlDatabase.__init__(self, None) + autorollback = kwargs.pop('autorollback', True) + + PostgresqlDatabase.__init__(self, None, autorollback=autorollback) DatabaseConnection.__init__(self, *args, **kwargs) @property