summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/util
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-12-01 17:24:27 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2020-05-24 11:54:08 -0400
commitdce8c7a125cb99fad62c76cd145752d5afefae36 (patch)
tree352dfa2c38005207ca64f45170bbba2c0f8c927e /lib/sqlalchemy/util
parent1502b5b3e4e4b93021eb927a6623f288ef006ba6 (diff)
downloadsqlalchemy-dce8c7a125cb99fad62c76cd145752d5afefae36.tar.gz
Unify Query and select() , move all processing to compile phase
Convert Query to do virtually all compile state computation in the _compile_context() phase, and organize it all such that a plain select() construct may also be used as the source of information in order to generate ORM query state. This makes it such that Query is not needed except for its additional methods like from_self() which are all to be deprecated. The construction of ORM state will occur beyond the caching boundary when the new execution model is integrated. future select() gains a working join() and filter_by() method. as we continue to rebase and merge each commit in the steps, callcounts continue to bump around. will have to look at the final result when it's all in. References: #5159 References: #4705 References: #4639 References: #4871 References: #5010 Change-Id: I19e05b3424b07114cce6c439b05198ac47f7ac10
Diffstat (limited to 'lib/sqlalchemy/util')
-rw-r--r--lib/sqlalchemy/util/_collections.py6
-rw-r--r--lib/sqlalchemy/util/langhelpers.py9
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/sqlalchemy/util/_collections.py b/lib/sqlalchemy/util/_collections.py
index 065935c48..9a832ba1b 100644
--- a/lib/sqlalchemy/util/_collections.py
+++ b/lib/sqlalchemy/util/_collections.py
@@ -103,6 +103,12 @@ class FacadeDict(ImmutableContainer, dict):
def __init__(self, *args):
pass
+ # note that currently, "copy()" is used as a way to get a plain dict
+ # from an immutabledict, while also allowing the method to work if the
+ # dictionary is already a plain dict.
+ # def copy(self):
+ # return immutabledict.__new__(immutabledict, self)
+
def __reduce__(self):
return FacadeDict, (dict(self),)
diff --git a/lib/sqlalchemy/util/langhelpers.py b/lib/sqlalchemy/util/langhelpers.py
index bd670f2cc..f6fefc244 100644
--- a/lib/sqlalchemy/util/langhelpers.py
+++ b/lib/sqlalchemy/util/langhelpers.py
@@ -930,6 +930,8 @@ class HasMemoized(object):
"""
+ __slots__ = ()
+
_memoized_keys = frozenset()
def _reset_memoizations(self):
@@ -1273,13 +1275,18 @@ class hybridmethod(object):
def __init__(self, func):
self.func = func
+ self.clslevel = func
def __get__(self, instance, owner):
if instance is None:
- return self.func.__get__(owner, owner.__class__)
+ return self.clslevel.__get__(owner, owner.__class__)
else:
return self.func.__get__(instance, owner)
+ def classlevel(self, func):
+ self.clslevel = func
+ return self
+
class _symbol(int):
def __new__(self, name, doc=None, canonical=None):