From 7c1dec5a400b6ee8c4f9bc8bbbd115e69da0302c Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Tue, 4 Jul 2023 10:10:39 +0200 Subject: [PATCH] SQLAlchemy: Fix SQL statement caching for CrateDB's `OBJECT` type The SQLAlchemy implementation of CrateDB's `OBJECT` type offers indexed access to the instance's content in form of a dictionary. Thus, it must not use `cache_ok = True` on its implementation, i.e. this part of the compiled SQL clause must not be cached. --- CHANGES.txt | 2 ++ src/crate/client/sqlalchemy/types.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index f8d0f54a..4774ed76 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,6 +8,8 @@ Unreleased - SQLAlchemy DDL: Allow turning off column store using ``crate_columnstore=False``. Thanks, @fetzerms. +- SQLAlchemy: Fix SQL statement caching for CrateDB's ``OBJECT`` type. + 2023/04/18 0.31.1 ================= diff --git a/src/crate/client/sqlalchemy/types.py b/src/crate/client/sqlalchemy/types.py index 1a3d7a06..587858ac 100644 --- a/src/crate/client/sqlalchemy/types.py +++ b/src/crate/client/sqlalchemy/types.py @@ -132,7 +132,7 @@ def __eq__(self, other): class _Craty(sqltypes.UserDefinedType): - cache_ok = True + cache_ok = False class Comparator(sqltypes.TypeEngine.Comparator):