("type", InternalTraversal.dp_type),
("callable", InternalTraversal.dp_plain_dict),
("value", InternalTraversal.dp_plain_obj),
+ ("literal_execute", InternalTraversal.dp_boolean),
]
key: str
self.__class__,
self.type._static_cache_key,
self.key % anon_map if self._key_is_anon else self.key,
+ self.literal_execute,
)
def _convert_to_unique(self):
),
lambda: (
bindparam("x"),
+ bindparam("x", literal_execute=True),
bindparam("y"),
bindparam("x", type_=Integer),
bindparam("x", type_=String),
def test_compare_binds(self):
b1 = bindparam("foo", type_=Integer())
+ b1l = bindparam("foo", type_=Integer(), literal_execute=True)
b2 = bindparam("foo", type_=Integer())
b3 = bindparam("foo", type_=String())
return 6
b4 = bindparam("foo", type_=Integer(), callable_=c1)
+ b4l = bindparam(
+ "foo", type_=Integer(), callable_=c1, literal_execute=True
+ )
b5 = bindparam("foo", type_=Integer(), callable_=c2)
b6 = bindparam("foo", type_=Integer(), callable_=c1)
is_false(b7.compare(b8))
is_true(b7.compare(b7))
+ # cache key
+ def compare_key(left, right, expected):
+ lk = left._generate_cache_key().key
+ rk = right._generate_cache_key().key
+ is_(lk == rk, expected)
+
+ compare_key(b1, b4, True)
+ compare_key(b1, b5, True)
+ compare_key(b8, b5, True)
+ compare_key(b8, b7, True)
+ compare_key(b8, b3, False)
+ compare_key(b1, b1l, False)
+ compare_key(b1, b4l, False)
+ compare_key(b4, b4l, False)
+ compare_key(b7, b4l, False)
+
def test_compare_tables(self):
is_true(table_a.compare(table_a_2))