From e5d7dfea4764f3ee57bf486a0484309c8469853d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20S=C3=A1nchez-Gallego?= Date: Mon, 8 Jun 2020 22:10:53 -0600 Subject: [PATCH] Use autorollback=True by default in PeeweeDatabaseConnection --- CHANGELOG.rst | 1 + python/sdssdb/connection.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) 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