]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
don't cache TypeDecorator by default
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 6 May 2021 16:24:00 +0000 (12:24 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 6 May 2021 17:57:43 +0000 (13:57 -0400)
commit6967b4502079e199b12f5eb307d10d27ec92d537
tree01ac7d137bee27bfd8ec9432639115327e1fe636
parent900d76b8f757a8a42bfb8fc737d24a94eeeac05f
don't cache TypeDecorator by default

The :class:`.TypeDecorator` class will now emit a warning when used in SQL
compilation with caching unless the ``.cache_ok`` flag is set to ``True``
or ``False``. ``.cache_ok`` indicates that all the parameters passed to the
object are safe to be used as a cache key, ``False`` means they are not.

Fixes: #6436
Change-Id: Ib1bb7dc4b124e38521d615c2e2e691e4915594fb
36 files changed:
doc/build/changelog/unreleased_14/6436.rst [new file with mode: 0644]
doc/build/core/custom_types.rst
lib/sqlalchemy/dialects/mssql/information_schema.py
lib/sqlalchemy/dialects/sqlite/pysqlite.py
lib/sqlalchemy/sql/sqltypes.py
lib/sqlalchemy/sql/traversals.py
lib/sqlalchemy/sql/type_api.py
lib/sqlalchemy/testing/suite/test_types.py
test/dialect/mssql/test_types.py
test/dialect/mysql/test_compiler.py
test/dialect/mysql/test_types.py
test/dialect/oracle/test_compiler.py
test/dialect/oracle/test_types.py
test/dialect/postgresql/test_dialect.py
test/dialect/postgresql/test_on_conflict.py
test/dialect/postgresql/test_types.py
test/dialect/test_sqlite.py
test/engine/test_execute.py
test/ext/mypy/files/type_decorator.py
test/ext/test_mutable.py
test/orm/test_lazy_relations.py
test/orm/test_naturalpks.py
test/orm/test_query.py
test/orm/test_relationships.py
test/orm/test_unitofworkv2.py
test/orm/test_versioning.py
test/sql/test_compare.py
test/sql/test_defaults.py
test/sql/test_metadata.py
test/sql/test_operators.py
test/sql/test_query.py
test/sql/test_resultset.py
test/sql/test_returning.py
test/sql/test_selectable.py
test/sql/test_type_expressions.py
test/sql/test_types.py