PrepareManager's methods maybe_add_to_cache() and validate() are said to
only be used in pipeline mode, but this is wrong as can be seen in
BaseCursor._maybe_prepare_gen(). (Comments are probably a left-over from
a prior implementation of the pipeline mode.)
If a new entry has been added, return its key. Return None otherwise
(meaning the query is already in cache or cache is not enabled).
-
- Note: This method is only called in pipeline mode.
"""
# don't do anything if prepared statements are disabled
if self.prepare_threshold is None:
"""Validate cached entry with 'key' by checking query 'results'.
Possibly return a command to perform maintenance on database side.
-
- Note: this method is only called in pipeline mode.
"""
if self._should_discard(prep, results):
return