Here are the examples of the python api sqlalchemy.join.params taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
0
Source : test_external_traversal.py
with MIT License
from sqlalchemy
with MIT License
from sqlalchemy
def test_params_subqueries_in_joins_one(self):
"""test #7055"""
meta = MetaData()
Pe = Table(
"pe",
meta,
Column("c", Integer),
Column("p", Integer),
Column("pid", Integer),
)
S = Table(
"s",
meta,
Column("c", Integer),
Column("p", Integer),
Column("sid", Integer),
)
Ps = Table("ps", meta, Column("c", Integer), Column("p", Integer))
params = {"pid": 42, "sid": 33}
pe_s = select(Pe).where(Pe.c.pid == bindparam("pid")).alias("pe_s")
s_s = select(S).where(S.c.sid == bindparam("sid")).alias("s_s")
jj = join(
Ps,
join(pe_s, s_s, and_(pe_s.c.c == s_s.c.c, pe_s.c.p == s_s.c.p)),
and_(Ps.c.c == pe_s.c.c, Ps.c.p == Ps.c.p),
).params(params)
eq_(
[
eq_clause_element(bindparam("pid", value=42)),
eq_clause_element(bindparam("sid", value=33)),
],
jj._generate_cache_key()[1],
)
def test_params_subqueries_in_joins_two(self):