aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorWolfgang Müller2021-05-07 13:30:06 +0200
committerWolfgang Müller2021-05-07 13:30:06 +0200
commitd5b8364405bd834e2600bac24701207187aa745b (patch)
tree68605954162c5aa1d1c2a45e892ad486b2fab4ad
parentb867d187d2c341020c3f1640d94780b59b5baa32 (diff)
downloadquarg-d5b8364405bd834e2600bac24701207187aa745b.tar.gz
tables: Indicate that the DateTimeUTC TypeDecorator may be cached
The cache_ok flag was added [1] in SQLAlchemy 1.4.14 and emits a warning if not set to either True or False. Since DateTimeUTC should be fine to cache, indicate True here. [1] https://docs.sqlalchemy.org/en/14/core/custom_types.html#sqlalchemy.types.TypeDecorator.cache_ok
-rw-r--r--quarg/database/tables.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/quarg/database/tables.py b/quarg/database/tables.py
index cdb3b68..6e92c14 100644
--- a/quarg/database/tables.py
+++ b/quarg/database/tables.py
@@ -16,6 +16,8 @@ class DateTimeUTC(TypeDecorator):
# pylint: disable=abstract-method
impl = TypeEngine
+ cache_ok = True
+
def load_dialect_impl(self, dialect):
if dialect.name == 'sqlite':
return dialect.type_descriptor(Integer)