(self)
| 675 | ) |
| 676 | |
| 677 | def test_functions_with_cols(self): |
| 678 | users = table( |
| 679 | "users", column("id"), column("name"), column("fullname") |
| 680 | ) |
| 681 | calculate = ( |
| 682 | select(column("q"), column("z"), column("r")) |
| 683 | .select_from( |
| 684 | func.calculate(bindparam("x", None), bindparam("y", None)) |
| 685 | ) |
| 686 | .subquery() |
| 687 | ) |
| 688 | |
| 689 | self.assert_compile( |
| 690 | select(users).where(users.c.id > calculate.c.z), |
| 691 | "SELECT users.id, users.name, users.fullname " |
| 692 | "FROM users, (SELECT q, z, r " |
| 693 | "FROM calculate(:x, :y)) AS anon_1 " |
| 694 | "WHERE users.id > anon_1.z", |
| 695 | ) |
| 696 | |
| 697 | with expect_deprecated( |
| 698 | r"The params\(\) and unique_params\(\) methods on non-statement" |
| 699 | ): |
| 700 | s = select(users).where( |
| 701 | users.c.id.between( |
| 702 | calculate.alias("c1").unique_params(x=17, y=45).c.z, |
| 703 | calculate.alias("c2").unique_params(x=5, y=12).c.z, |
| 704 | ), |
| 705 | ) |
| 706 | |
| 707 | self.assert_compile( |
| 708 | s, |
| 709 | "SELECT users.id, users.name, users.fullname " |
| 710 | "FROM users, (SELECT q, z, r " |
| 711 | "FROM calculate(:x_1, :y_1)) AS c1, (SELECT q, z, r " |
| 712 | "FROM calculate(:x_2, :y_2)) AS c2 " |
| 713 | "WHERE users.id BETWEEN c1.z AND c2.z", |
| 714 | checkparams={"y_1": 45, "x_1": 17, "y_2": 12, "x_2": 5}, |
| 715 | ) |
| 716 | |
| 717 | def test_non_functions(self): |
| 718 | expr = func.cast("foo", Integer) |
nothing calls this directly
no test coverage detected